Changeset 371
- Timestamp:
- 09/17/08 12:41:08 (4 months ago)
- Files:
-
- jasko.tim.lisp/slime/CVS (deleted)
- jasko.tim.lisp/slime/ChangeLog (modified) (1 diff)
- jasko.tim.lisp/slime/contrib/CVS/Entries (deleted)
- jasko.tim.lisp/slime/contrib/CVS/Repository (deleted)
- jasko.tim.lisp/slime/contrib/CVS/Root (deleted)
- jasko.tim.lisp/slime/contrib/CVS/Template (deleted)
- jasko.tim.lisp/slime/contrib/ChangeLog (modified) (1 diff)
- jasko.tim.lisp/slime/contrib/slime-fancy.el (modified) (1 diff)
- jasko.tim.lisp/slime/contrib/slime-fuzzy.el (modified) (1 diff)
- jasko.tim.lisp/slime/contrib/slime-indentation.el (modified) (1 diff)
- jasko.tim.lisp/slime/contrib/slime-presentations.el (modified) (1 diff)
- jasko.tim.lisp/slime/contrib/swank-arglists.lisp (modified) (1 diff)
- jasko.tim.lisp/slime/contrib/swank-listener-hooks.lisp (modified) (1 diff)
- jasko.tim.lisp/slime/doc/.cvsignore (deleted)
- jasko.tim.lisp/slime/doc/CVS (deleted)
- jasko.tim.lisp/slime/metering.lisp (modified) (2 diffs)
- jasko.tim.lisp/slime/slime.el (modified) (20 diffs)
- jasko.tim.lisp/slime/swank-abcl.lisp (modified) (1 diff)
- jasko.tim.lisp/slime/swank-backend.lisp (modified) (6 diffs)
- jasko.tim.lisp/slime/swank-cmucl.lisp (modified) (4 diffs)
- jasko.tim.lisp/slime/swank-ecl.lisp (modified) (3 diffs)
- jasko.tim.lisp/slime/swank-gray.lisp (modified) (3 diffs)
- jasko.tim.lisp/slime/swank-sbcl.lisp (modified) (3 diffs)
- jasko.tim.lisp/slime/swank-scl.lisp (modified) (4 diffs)
- jasko.tim.lisp/slime/swank.lisp (modified) (30 diffs)
- jasko.tim.lisp/slime/test.sh (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
jasko.tim.lisp/slime/ChangeLog
r320 r371 1 2008-08-31 Helmut Eller <heller@common-lisp.net>2 3 * swank-backend.lisp (*gray-stream-symbols*): Remove4 stream-file-position because it's called stream-position in CCL.5 (make-fn-streams): Deleted.6 Update callers accordingly.7 8 2008-08-30 Helmut Eller <heller@common-lisp.net>9 10 * swank-sbcl.lisp (receive-if): Add #+/-linux to avoid yet more11 WITH-TIMEOUT related problems.12 13 * swank-gray.lisp (slime-input-stream): Remove the output stream14 slot. Most of the time we can just call force-output.15 16 * slime.el [test](inspector): New test.17 18 * swank.lisp (prepare-part): Also wrap action elements19 in a list. Reported by Ariel Badichi and Madhu.20 21 2008-08-30 Helmut Eller <heller@common-lisp.net>22 23 * slime.el (slime-pop-to-buffer): Drop the norecord argument,24 since we can't support it easily in Emacs 21.25 Reported by Christophe Rhodes.26 27 2008-08-30 Michael Weber <michaelw+slime@foldr.org>28 29 * swank-gray.lisp (make-input-stream): fixed typos30 31 2008-08-30 Michael Weber <michaelw+slime@foldr.org>32 33 * swank-backend.lisp (*gray-stream-symbols*): added symbols34 stream-peek-char, stream-read-line, stream-file-position35 36 2008-08-30 Mark Evenson <evenson@panix.com>37 38 * swank-abcl.lisp (make-output-stream, make-input-stream): provide39 the (trivial) definitions for MAKE-OUTPUT-STREAM and40 MAKE-INPUT-STREAM for ABCL.41 42 2008-08-27 Helmut Eller <heller@common-lisp.net>43 44 * slime.el (sldb-setup): Insert "No backtrace" if the backtrace is45 empty.46 47 2008-08-27 Anton Vodonosov <avodonosov@yandex.ru>48 49 * swank-ecl.lisp: Add :load-toplevel and :execute to EVAL-WHENs to50 fix loading.51 52 2008-08-27 Helmut Eller <heller@common-lisp.net>53 54 * swank-cmucl.lisp (remove-sigio-handlers): Fix thinko.55 56 * swank.lisp (decode-message): Don't ignore EOF.57 (swank-debugger-hook): Remove the default-debugger restart.58 59 2008-08-25 Tobias C. Rittweiler <tcr@freebits.de>60 61 * slime.el (slime-compute-modeline-package): Used `when-let' before its definition.62 (slime-compute-modeline-string): Display "PKG:" before "CON:".63 64 2008-08-22 Helmut Eller <heller@common-lisp.net>65 66 Some focus handling in multiframe setups.67 68 * slime.el (slime-pop-to-buffer): New function.69 (slime-switch-to-output-buffer): Use it.70 71 2008-08-22 Helmut Eller <heller@common-lisp.net>72 73 Use lazy lists in the inspector.74 75 * swank.lisp (lcons): New data type.76 (lcons*, lcons-car, lcons-cdr, llist-range): New functions.77 (emacs-inspect array): Use lazy lists.78 (istate>elisp): The istate.content is now be a lazy list.79 (iline): New utility.80 (prepare-range, prepare-part): Replaces inspector-content.81 82 2008-08-22 Helmut Eller <heller@common-lisp.net>83 84 Implement streams with a length limit.85 Use them to truncate printer output in backtraces.86 87 * swank-backend.lisp (make-output-stream, make-input-stream):88 Split make-fn-streams up into two functions.89 90 * swank.lisp (call/truncated-output-to-string): New function.91 (backtrace, istate>elisp, to-line): Use it.92 (frame-locals-for-emacs): Use to-line.93 94 2008-08-22 Helmut Eller <heller@common-lisp.net>95 96 In backtraces, escape newlines in strings as \n.97 98 * swank.lisp (*backtrace-pprint-dispatch-table*): New.99 (*backtrace-printer-bindings*): Use it.100 101 2008-08-22 Stas Boukarev <stassats@gmail.com>102 103 * metering.lisp: Add deftypes for time-type and cons-type, which104 are not defined in newer versions of CCL.105 106 2008-08-22 Stelian Ionescu <sionescu@common-lisp.net>107 108 * swank-ecl.lisp: Add a few EVAL-WHENs to fix compilation.109 110 2008-08-22 Helmut Eller <heller@common-lisp.net>111 112 Collect most of the inspector state in a structure.113 Truncate the printer output more aggressively.114 115 * swank.lisp (inspector-state): New structure.116 (*istate*): New variable holds the current state.117 (inspect-object, inspector-content, inspector-nth-part)118 (inspector-range, inspector-call-nth-action, describe-inspectee):119 Use it.120 (inspector-pop, inspector-next): Implemented forward/backward a121 bit differently.122 (emacs-inspect/printer-bindings, istate>elisp): New functions.123 (to-line, truncate-string): New functions.124 125 2008-08-22 Tobias C. Rittweiler <tcr@freebits.de>126 127 Compiling a file `let*.lisp' on SBCL via C-c C-k resulted in an128 error, because it parsed the asterisk to a wild pathname. Fix129 that.130 131 * swank-backend.lisp (definterface parse-emacs-filename): New.132 PARSE-NAMESTRING by default.133 134 * swank-sbcl.lisp (defimplementation parse-emacs-filename): Use135 SB-EXT:PARSE-NATIVE-NAMESTRING.136 137 * swank.lisp (compile-file-for-emacs): Use PARSE-EMACS-FILENAME.138 (compile-file-if-needed): Ditto.139 (load-file): Ditto.140 (swank-require): Ditto.141 142 2008-08-18 Helmut Eller <heller@common-lisp.net>143 144 * swank.lisp (install-fd-handler): Bind *emacs-connection* with145 with-connection, for case when the signal hander is called out of146 the blue.147 (swank-debugger-hook): Don't assume that the hook argument is148 #'swank-debugger-hook itself.149 150 * test.sh (usage): Use cat rather not echo for here-documents.151 152 2008-08-17 Helmut Eller <heller@common-lisp.net>153 154 * slime.el (slime-inspector-show-source): New command.155 (slime-inspector-mode-map): Bind it to ".".156 (sldb-highlight-sexp): Use slime-flash-region rather than a157 permanent overlay.158 (slime-popup-buffer-quit): Must call bury-buffer without argument.159 160 * swank.lisp (find-source-location-for-emacs): New function.161 162 * slime.el (slime-add-local-hook): Renamed from add-local-hook.163 (slime-switch-to-output-buffer): Drop the connection argument. It164 was never used.165 (slime-switch-to-output-buffer-search-all-frames): Deleted. Use166 display-buffer-reuse-frames instead.167 (slime-switch-to-output-buffer): Use pop-to-buffer to select the168 window and frame.169 170 2008-08-15 Tobias C. Rittweiler <tcr@freebits.de>171 172 * slime.el (slime-switch-to-output-buffer): Fix regression173 discovered by Ariel Badichi. Programmatic invocation of this174 function expect this function to also set-buffer to the REPL175 buffer. Even though that's ugly, we do it for now, and declare it176 to be a FIXME.177 (slime-dispatch-event): Don't use `message' for the pipelined178 request message, but `slime-display-oneliner' which will truncate179 the form to be displayed.180 181 2008-08-17 Helmut Eller <heller@common-lisp.net>182 183 * swank-cmucl.lisp (waitpid): Don't use unix::pid-t, it's only184 defined for Linux.185 186 * swank-sbcl.lisp (sb-thread::get-foreground): Don't override.187 Let SBCL people fix this.188 189 2008-08-17 B.Scott Michel <scooter.phd@gmail.com>190 191 * swank-loader.lisp (dump-image): Move this function to the end of192 the file to stop SBCL from reporting two times the same false193 alarm.194 195 2008-08-15 Tobias C. Rittweiler <tcr@freebits.de>196 197 * slime.el (slime-popup-buffer-quit): Fix regression; we have to198 invoke `bury-buffer' without an argument to make it switch buffers199 for us (for the case when the snapshot wasn't restored.)200 201 2008-08-15 Tobias C. Rittweiler <tcr@freebits.de>202 203 * slime.el (slime-list-compiler-notes): Only shrink if notes tree204 isn't displayed as being collapsed.205 206 2008-08-15 Tobias C. Rittweiler <tcr@freebits.de>207 208 * slime.el (slime-popup-buffer-quit): If not kill, then at least209 bury the buffer.210 (slime-list-compiler-notes): Shrink the compiler-notes window.211 212 1 2008-08-14 Tobias C. Rittweiler <tcr@freebits.de> 213 2 jasko.tim.lisp/slime/contrib/ChangeLog
r320 r371 1 2008-08-27 Helmut Eller <heller@common-lisp.net>2 3 * swank-arglists.lisp (variable-desc-for-echo-area): Limit the4 length to one line to avoid (some) problems with big or circular5 values. Reported by Stas Boukarev.6 7 2008-08-22 Stelian Ionescu <sionescu@common-lisp.net>8 9 * swank-listener-hooks.lisp: Add missing IN-PACKAGE.10 11 2008-08-20 Tobias C. Rittweiler <tcr@freebits.de>12 13 * slime-fontifying-fu.el: New contrib; fontify with-foo and do-foo14 like standard macros.15 16 * slime-fancy.el: Add slime-fontifying-fu.17 18 2008-08-20 Luís Oliveira <loliveira@common-lisp.net>19 20 * contrib/slime-indentation.el: fix indentation of IF forms.21 22 2008-08-18 Ariel Badichi <abadichi@bezeqint.net>23 24 * slime-fuzzy.el: Rename `add-local-hook' to `slime-add-local-hook'.25 * slime-presentations.el: Ditto.26 27 1 2008-08-12 Helmut Eller <heller@common-lisp.net> 28 2 jasko.tim.lisp/slime/contrib/slime-fancy.el
r320 r371 80 80 (slime-package-fu-init) 81 81 82 ;; Fontify with-foo and do-foo like standard macros.83 (require 'slime-fontifying-fu)84 (slime-fontifying-fu-init)85 86 82 (provide 'slime-fancy) jasko.tim.lisp/slime/contrib/slime-fuzzy.el
r320 r371 360 360 (add-hook 'window-configuration-change-hook 361 361 'slime-fuzzy-window-configuration-change)) 362 ( slime-add-local-hook 'kill-buffer-hook 'slime-fuzzy-abort)362 (add-local-hook 'kill-buffer-hook 'slime-fuzzy-abort) 363 363 (setq buffer-quit-function 'slime-fuzzy-abort)) ; M-Esc Esc 364 364 (when slime-fuzzy-completion-in-place jasko.tim.lisp/slime/contrib/slime-indentation.el
r320 r371 1066 1066 &body)) 1067 1067 (labels . flet) (macrolet . flet) 1068 (if (&rest 4))1068 (if (&rest 2)) 1069 1069 ;; FIXME: Which of those do I really want? 1070 1070 ;; (lambda ((&whole 4 &rest 1) &body)) jasko.tim.lisp/slime/contrib/slime-presentations.el
r320 r371 859 859 ;; Respect the syntax text properties of presentation. 860 860 (set (make-local-variable 'parse-sexp-lookup-properties) t) 861 ( slime-add-local-hook 'after-change-functions862 'slime-after-change-function)))861 (add-local-hook 'after-change-functions 862 'slime-after-change-function))) 863 863 (add-hook 'slime-event-hooks 'slime-dispatch-presentation-event) 864 864 (setq slime-write-string-function 'slime-presentation-write) jasko.tim.lisp/slime/contrib/swank-arglists.lisp
r320 r371 477 477 (let ((sym (parse-symbol variable-name))) 478 478 (if (and sym (boundp sym)) 479 (let ((*print-pretty* t) (*print-level* 4) 480 (*print-length* 10) (*print-lines* 1)) 481 (call/truncated-output-to-string 482 75 (lambda (s) 483 (format s "~A => ~A" sym (symbol-value sym))))))))) 479 (let ((*print-pretty* nil) (*print-level* 4) 480 (*print-length* 10) (*print-circle* t)) 481 (format nil "~A => ~A" sym (symbol-value sym))))))) 484 482 485 483 (defun decode-required-arg (arg) jasko.tim.lisp/slime/contrib/swank-listener-hooks.lisp
r320 r371 5 5 ;; I guess that only Alan Ruttenberg knows how to use this code. It 6 6 ;; was in swank.lisp for a long time, so here it is. -- Helmut Eller 7 8 (in-package :swank)9 7 10 8 (defvar *slime-repl-advance-history* nil jasko.tim.lisp/slime/metering.lisp
r320 r371 61 61 ;;; Purely to cut down on stale code (e.g. #+cltl2) in this 62 62 ;;; version that is bundled with SLIME. 63 ;;; 22-Aug-08 stas Define TIME-TYPE for Clozure CL.63 ;;; 64 64 ;;; 65 65 … … 401 401 402 402 (defconstant time-units-per-second internal-time-units-per-second) 403 404 #+openmcl405 (progn406 (deftype time-type () 'unsigned-byte)407 (deftype consing-type () 'unsigned-byte))408 403 409 404 (defmacro get-time () jasko.tim.lisp/slime/slime.el
r320 r371 449 449 (defun slime-compute-modeline-package () 450 450 (when (memq major-mode slime-lisp-modes) 451 ;; WHEN-LET is defined later. 452 (let ((package (slime-current-package))) 453 (when package 454 (slime-pretty-package-name package))))) 451 (when-let (package (slime-current-package)) 452 (slime-pretty-package-name package)))) 455 453 456 454 (defun slime-pretty-package-name (name) … … 477 475 (defun slime-compute-modeline-string (conn state pkg) 478 476 (concat (when (or conn pkg) "[") 479 (when pkg (format "PKG:%s" pkg))480 (when (and (or conn state) pkg) ", ")481 477 (when conn (format "CON:%s" conn)) 482 478 (when state (format "{%s}" state)) 479 (when (and (or conn state) pkg) ", ") 480 (when pkg (format "PKG:%s" pkg)) 483 481 (when (or conn pkg) "]"))) 484 482 … … 669 667 (defun slime-setup-command-hooks () 670 668 "Setup a buffer-local `pre-command-hook' to call `slime-pre-command-hook'." 671 ( slime-add-local-hook 'pre-command-hook 'slime-pre-command-hook)672 ( slime-add-local-hook 'post-command-hook 'slime-post-command-hook))669 (add-local-hook 'pre-command-hook 'slime-pre-command-hook) 670 (add-local-hook 'post-command-hook 'slime-post-command-hook)) 673 671 674 672 … … 1045 1043 last activated the buffer." 1046 1044 (interactive) 1047 (let ((buffer (current-buffer))) 1048 (when (slime-popup-buffer-snapshot-unchanged-p) 1049 (slime-popup-buffer-restore-snapshot)) 1045 (let ((popup-buffer (current-buffer))) 1046 (if (slime-popup-buffer-snapshot-unchanged-p) 1047 (slime-popup-buffer-restore-snapshot) 1048 (bury-buffer)) 1050 1049 (setq slime-popup-buffer-saved-emacs-snapshot nil) 1051 ( cond (kill-buffer-p (kill-buffer buffer))1052 (t (with-current-buffer buffer (bury-buffer))))))1050 (when kill-buffer-p 1051 (kill-buffer popup-buffer)))) 1053 1052 1054 1053 (defun slime-popup-buffer-snapshot-unchanged-p () … … 1058 1057 (defun slime-popup-buffer-restore-snapshot () 1059 1058 (let ((snapshot slime-popup-buffer-saved-emacs-snapshot)) 1060 (assert snapshot) 1061 (slime-set-emacs-snapshot snapshot))) 1059 (assert snapshot) (slime-set-emacs-snapshot snapshot))) 1060 1062 1061 1063 1062 ;;;;; Filename translation … … 2234 2233 (unless (member tag slime-stack-eval-tags) 2235 2234 (error "Reply to canceled synchronous eval request tag=%S sexp=%S" 2236 tag s exp))2235 tag slime-stack-eval-tags sexp)) 2237 2236 (throw tag (list #'identity value))) 2238 2237 ((:abort) … … 2332 2331 ((:emacs-rex form package thread continuation) 2333 2332 (when (and (slime-use-sigint-for-interrupt) (slime-busy-p)) 2334 ( slime-display-oneliner"; pipelined request... %S" form))2333 (message "; pipelined request... %S" form)) 2335 2334 (let ((id (incf (slime-continuation-counter)))) 2336 2335 (push (cons id continuation) (slime-rex-continuations)) … … 2699 2698 (set-marker marker (point))))))) 2700 2699 2701 (defun slime-switch-to-output-buffer () 2702 "Select the output buffer, when possible in an existing window. 2703 2704 Hint: You can use `display-buffer-reuse-frames' and 2705 `special-display-buffer-names' to customize the frame in which 2706 the buffer should appear." 2707 (interactive) 2708 (slime-pop-to-buffer (slime-output-buffer)) 2709 (goto-char (point-max))) 2700 (defvar slime-switch-to-output-buffer-search-all-frames t 2701 "If t search for an already existing REPL window in all frames, 2702 and if found, select that window instead of creating a new one. 2703 2704 If you use multiple screens, you may want to set this to nil such 2705 that a window on a different screen won't be selected under the 2706 hood.") 2707 2708 (defun slime-switch-to-output-buffer (&optional connection) 2709 "Select the output buffer: If a REPL is already displayed, just 2710 set focus to that window. Otherwise, try to make a new window 2711 displaying the REPL." 2712 (interactive) 2713 (let ((slime-dispatching-connection (or connection 2714 slime-dispatching-connection))) 2715 (let* ((repl-buffer (slime-output-buffer)) 2716 (all-frames-p slime-switch-to-output-buffer-search-all-frames) 2717 (repl-window (get-buffer-window repl-buffer all-frames-p))) 2718 (if repl-window 2719 (progn (select-frame-set-input-focus (window-frame repl-window)) 2720 (select-window repl-window)) 2721 (set-buffer repl-buffer) 2722 (unless (eq (current-buffer) (window-buffer)) 2723 (pop-to-buffer (current-buffer) t)))) 2724 (goto-char (point-max)))) 2710 2725 2711 2726 … … 2860 2875 (when slime-repl-history-file 2861 2876 (slime-repl-safe-load-history) 2862 (slime-add-local-hook 'kill-buffer-hook 2863 'slime-repl-safe-save-merged-history)) 2877 (add-local-hook 'kill-buffer-hook 'slime-repl-safe-save-merged-history)) 2864 2878 (add-hook 'kill-emacs-hook 'slime-repl-save-all-histories) 2865 2879 (slime-setup-command-hooks) … … 4162 4176 (when (null notes) 4163 4177 (insert "[no notes]")) 4164 (let ((collapsed-p)) 4165 (dolist (tree (slime-compiler-notes-to-tree notes)) 4166 (when (slime-tree.collapsed-p tree) (setf collapsed-p t)) 4167 (slime-tree-insert tree "") 4168 (insert "\n")) 4169 (unless collapsed-p 4170 (shrink-window-if-larger-than-buffer)) 4171 (goto-char (point-min)))))) 4178 (dolist (tree (slime-compiler-notes-to-tree notes)) 4179 (slime-tree-insert tree "") 4180 (insert "\n")) 4181 (goto-char (point-min))))) 4172 4182 4173 4183 (defun slime-alistify (list key test) … … 4954 4964 4955 4965 (defun slime-complete-delay-restoration () 4956 (slime-add-local-hook 'pre-command-hook 4957 'slime-complete-maybe-restore-window-configuration)) 4966 (make-local-hook 'pre-command-hook) 4967 (add-hook 'pre-command-hook 4968 'slime-complete-maybe-restore-window-configuration)) 4958 4969 4959 4970 (defun slime-complete-forget-window-configuration () … … 6662 6673 ;; Make original slime-connection "sticky" for SLDB commands in this buffer 6663 6674 (setq slime-buffer-connection (slime-connection)) 6664 ( slime-add-local-hook 'kill-buffer-hook 'sldb-delete-overlays))6675 (add-local-hook 'kill-buffer-hook 'sldb-delete-overlays)) 6665 6676 6666 6677 (slime-define-keys sldb-mode-map … … 6780 6791 (setq sldb-backtrace-start-marker (point-marker)) 6781 6792 (save-excursion 6782 (if frames 6783 (sldb-insert-frames (sldb-prune-initial-frames frames) t) 6784 (insert "[No backtrace]"))) 6793 (sldb-insert-frames (sldb-prune-initial-frames frames) t)) 6785 6794 (run-hooks 'sldb-hook)) 6786 6795 (pop-to-buffer (current-buffer)) … … 7137 7146 (let ((start (or start (point))) 7138 7147 (end (or end (save-excursion (ignore-errors (forward-sexp)) (point))))) 7139 (slime-flash-region start end))) 7148 (push (make-overlay start (1+ start)) sldb-overlays) 7149 (push (make-overlay (1- end) end) sldb-overlays)) 7150 (dolist (overlay sldb-overlays) 7151 (overlay-put overlay 'face 'secondary-selection))) 7140 7152 7141 7153 (defun sldb-delete-overlays () … … 7869 7881 (slime-eval-describe `(swank:pprint-inspector-part ,part))) 7870 7882 7871 (defun slime-inspector-show-source (part)7872 (interactive (list (or (get-text-property (point) 'slime-part-number)7873 (error "No part at point"))))7874 (slime-eval-async7875 `(swank:find-source-location-for-emacs '(:inspector ,part))7876 #'slime-show-source-location))7877 7878 7883 (defun slime-inspector-reinspect () 7879 7884 (interactive) … … 7949 7954 ([(shift tab)] 'slime-inspector-previous-inspectable-object) ; Emacs translates S-TAB 7950 7955 ([backtab] 'slime-inspector-previous-inspectable-object) ; to BACKTAB on X. 7951 ("\M-." 'slime-edit-definition) 7952 ("." 'slime-inspector-show-source)) 7956 ("\M-." 'slime-edit-definition)) 7953 7957 7954 7958 … … 8431 8435 "The name of the buffer used to display test results.") 8432 8436 8433 (defvar slime-lisp-under-test nil8434 "The name of Lisp currently executing the tests.")8435 8437 8436 8438 ;; dynamically bound during a single test … … 9244 9246 (not (not (get-buffer-window (current-buffer))))))) 9245 9247 9246 (def-slime-test inspector9247 (exp)9248 "Test basic inspector workingness."9249 '(((let ((h (make-hash-table)))9250 (loop for i below 10 do (setf (gethash i h) i))9251 h))9252 ((make-array 10))9253 ((make-list 10))9254 ('cons)9255 (#'cons))9256 (slime-inspect (prin1-to-string exp))9257 (assert (not (slime-inspector-visible-p)))9258 (slime-wait-condition "Inspector visible" #'slime-inspector-visible-p 5)9259 (with-current-buffer (window-buffer (selected-window))9260 (slime-inspector-quit))9261 (slime-wait-condition "Inspector closed"9262 (lambda () (not (slime-inspector-visible-p)))9263 5)9264 (slime-sync-to-top-level 1))9265 9266 (defun slime-inspector-visible-p ()9267 (let ((buffer (window-buffer (selected-window))))9268 (string-match "\\*Slime Inspector\\*"9269 (buffer-name buffer))))9270 9271 9248 (def-slime-test break 9272 9249 (times exp) … … 9673 9650 ;; Emacs 21 uses microsecs; Emacs 22 millisecs 9674 9651 (if timeout (truncate (* timeout 1000000))))))) 9675 9676 (defun slime-pop-to-buffer (buffer &optional other-window)9677 "Select buffer BUFFER in some window.9678 This is like `pop-to-buffer' but also sets the input focus9679 for (somewhat) better multiframe support."9680 (set-buffer buffer)9681 (let ((old-frame (selected-frame))9682 (window (display-buffer buffer other-window)))9683 (select-window window)9684 ;; select-window doesn't set the input focus9685 (when (and (not (featurep 'xemacs))9686 (>= emacs-major-version 22)9687 (not (eq old-frame (selected-frame))))9688 (select-frame-set-input-focus (window-frame window))))9689 buffer)9690 9691 (defun slime-add-local-hook (hook function &optional append)9692 (cond ((featurep 'xemacs) (add-local-hook hook function append))9693 ((< emacs-major-version 21)9694 (make-local-hook hook)9695 (add-hook hook function append t))9696 (t (add-hook hook function append t))))9697 9652 9698 9653 (slime-defun-if-undefined next-single-char-property-change … … 9969 9924 ,@body)) 9970 9925 9926 ;;; Stuff only available in XEmacs 9927 (slime-defun-if-undefined add-local-hook (hook function &optional append) 9928 (make-local-hook hook) 9929 (add-hook hook function append t)) 9930 9931 (slime-defun-if-undefined remove-local-hook (hook function) 9932 (if (local-variable-p hook (current-buffer)) 9933 (remove-hook hook function t))) 9934 9971 9935 9972 9936 ;;;; Finishing up jasko.tim.lisp/slime/swank-abcl.lisp
r320 r371 25 25 nil)) 26 26 27 (defimplementation make-output-stream (write-string) 28 (ext:make-slime-output-stream write-string)) 29 30 (defimplementation make-input-stream (read-string) 31 (ext:make-slime-input-stream read-string 32 (make-synonym-stream '*standard-output*))) 27 (defimplementation make-fn-streams (input-fn output-fn) 28 (let* ((output (ext:make-slime-output-stream output-fn)) 29 (input (ext:make-slime-input-stream input-fn output))) 30 (values input output))) 33 31 34 32 (defimplementation call-with-compilation-hooks (function) jasko.tim.lisp/slime/swank-backend.lisp
r320 r371 204 204 :fundamental-character-input-stream 205 205 :stream-read-char 206 :stream-peek-char207 :stream-read-line208 :stream-file-position209 206 :stream-listen 210 207 :stream-unread-char … … 373 370 ") 374 371 375 (definterface swank-compile-file ( pathname load-p external-format)376 "Compile PATHNAME signalling COMPILE-CONDITIONs.372 (definterface swank-compile-file (filename load-p external-format) 373 "Compile FILENAME signalling COMPILE-CONDITIONs. 377 374 If LOAD-P is true, load the file after compilation. 378 375 EXTERNAL-FORMAT is a value returned by find-external-format or … … 411 408 :accessor location))) 412 409 413 (definterface parse-emacs-filename (filename)414 "Return a PATHNAME for FILENAME. A filename in Emacs may for example415 contain asterisks which should not be translated to wildcards."416 (parse-namestring filename))417 418 410 (definterface find-external-format (coding-system) 419 411 "Return a \"external file format designator\" for CODING-SYSTEM. … … 424 416 nil)) 425 417 426 (definterface guess-external-format ( pathname)427 "Detect the external format for the file with name pathname.418 (definterface guess-external-format (filename) 419 "Detect the external format for the file with name FILENAME. 428 420 Return nil if the file contains no special markers." 429 421 ;; Look for a Emacs-style -*- coding: ... -*- or Local Variable: section. 430 (with-open-file (s pathname :if-does-not-exist nil422 (with-open-file (s filename :if-does-not-exist nil 431 423 :external-format (or (find-external-format "latin-1-unix") 432 424 :default)) … … 462 454 ;;;; Streams 463 455 464 (definterface make-output-stream (write-string) 465 "Return a new character output stream. 466 The stream calls WRITE-STRING when output is ready.") 467 468 (definterface make-input-stream (read-string) 469 "Return a new character input stream. 470 The stream calls READ-STRING when input is needed.") 456 (definterface make-fn-streams (input-fn output-fn) 457 "Return character input and output streams backended by functions. 458 When input is needed, INPUT-FN is called with no arguments to 459 return a string. 460 When output is ready, OUTPUT-FN is called with the output as its 461 argument. 462 463 Output should be forced to OUTPUT-FN before calling INPUT-FN. 464 465 The streams are returned as two values.") 471 466 472 467 … … 998 993 999 994 (definterface all-threads () 1000 "Return a freshlist of all threads.")995 "Return a list of all threads.") 1001 996 1002 997 (definterface thread-alive-p (thread) jasko.tim.lisp/slime/swank-cmucl.lisp
r320 r371 170 170 (let ((old-flags (fcntl fd unix:f-getfl 0))) 171 171 (fcntl fd unix:f-setfl (logior old-flags unix:fasync))) 172 (assert (not (assoc fd *sigio-handlers*)))173 172 (push (cons fd fn) *sigio-handlers*))) 174 173 175 174 (defimplementation remove-sigio-handlers (socket) 176 175 (let ((fd (socket-fd socket))) 177 ( when(assoc fd *sigio-handlers*)176 (unless (assoc fd *sigio-handlers*) 178 177 (setf *sigio-handlers* (remove fd *sigio-handlers* :key #'car)) 179 178 (let ((old-flags (fcntl fd unix:f-getfl 0))) 180 179 (fcntl fd unix:f-setfl (logandc2 old-flags unix:fasync))) 181 180 (sys:invalidate-descriptor fd)) 182 (assert (not (assoc fd *sigio-handlers*)))181 #+(or) 183 182 (when (null *sigio-handlers*) 184 (sys:default-interrupt :sigio)))) 183 (sys:default-interrupt :sigio)) 184 )) 185 185 186 186 ;;;;; SERVE-EVENT … … 197 197 ;;; XXX: How come we don't use Gray streams in CMUCL too? -luke (15/May/2004) 198 198 199 (defimplementation make-output-stream (write-string) 200 (make-slime-output-stream write-string)) 201 202 (defimplementation make-input-stream (read-string) 203 (make-slime-input-stream read-string)) 199 (defimplementation make-fn-streams (input-fn output-fn) 200 (let* ((output (make-slime-output-stream output-fn)) 201 (input (make-slime-input-stream input-fn output))) 202 (values input output))) 204 203 205 204 (defstruct (slime-output-stream … … 294 293 (:conc-name sis.) 295 294 (:print-function %print-slime-output-stream) 296 (:constructor make-slime-input-stream (input-fn )))295 (:constructor make-slime-input-stream (input-fn sos))) 297 296 (input-fn nil :type function) 297 ;; We know our sibling output stream, so that we can force it before 298 ;; requesting input. 299 (sos nil :type slime-output-stream) 298 300 (buffer "" :type string) 299 301 (index 0 :type kernel:index)) 300 302 301 303 (defun sis/in (stream eof-errorp eof-value) 304 (finish-output (sis.sos stream)) 302 305 (let ((index (sis.index stream)) 303 306 (buffer (sis.buffer stream))) … … 2286 2289 (let ((code (alien:alien-funcall 2287 2290 (alien:extern-alien 2288 waitpid (alien:function c-call:int c-call:int 2291 waitpid (alien:function unix::pid-t 2292 unix::pid-t 2289 2293 (* c-call:int) c-call:int)) 2290 2294 pid (alien:addr status) 0))) jasko.tim.lisp/slime/swank-ecl.lisp
r320 r371 13 13 (defvar *tmp*) 14 14 15 (eval-when (:compile-toplevel :load-toplevel :execute)16 15 (if (find-package :gray) 17 16 (import-from :gray *gray-stream-symbols* :swank-backend) … … 23 22 :generic-function-declarations 24 23 :specializer-direct-methods 25 :compute-applicable-methods-using-classes)) )24 :compute-applicable-methods-using-classes)) 26 25 27 26 28 27 ;;;; TCP Server 29 28 30 (eval-when (:compile-toplevel :load-toplevel :execute) 31 (require 'sockets)) 29 (require 'sockets) 32 30 33 31 (defun resolve-hostname (name) … … 221 219 ;;; Debugging 222 220 223 (eval-when (:compile-toplevel :load-toplevel :execute) 224 (import 225 '(si::*break-env* 226 si::*ihs-top* 227 si::*ihs-current* 228 si::*ihs-base* 229 si::*frs-base* 230 si::*frs-top* 231 si::*tpl-commands* 232 si::*tpl-level* 233 si::frs-top 234 si::ihs-top 235 si::ihs-fun 236 si::ihs-env 237 si::sch-frs-base 238 si::set-break-env 239 si::set-current-ihs 240 si::tpl-commands))) 221 (import 222 '(si::*break-env* 223 si::*ihs-top* 224 si::*ihs-current* 225 si::*ihs-base* 226 si::*frs-base* 227 si::*frs-top* 228 si::*tpl-commands* 229 si::*tpl-level* 230 si::frs-top 231 si::ihs-top 232 si::ihs-fun 233 si::ihs-env 234 si::sch-frs-base 235 si::set-break-env 236 si::set-current-ihs 237 si::tpl-commands)) 241 238 242 239 (defvar *backtrace* '()) jasko.tim.lisp/slime/swank-gray.lisp
r320 r371 78 78 79 79 (defclass slime-input-stream (fundamental-character-input-stream) 80 ((input-fn :initarg :input-fn) 80 ((output-stream :initarg :output-stream) 81 (input-fn :initarg :input-fn) 81 82 (buffer :initform "") (index :initform 0) 82 83 (lock :initform (make-lock :name "buffer read lock")))) … … 86 87 (slot-value s 'lock) 87 88 (lambda () 88 (with-slots (buffer index input-fn) s89 (with-slots (buffer index output-stream input-fn) s 89 90 (when (= index (length buffer)) 91 (when output-stream 92 (finish-output output-stream)) 90 93 (let ((string (funcall input-fn))) 91 94 (cond ((zerop (length string)) … … 159 162 160 163 ;;; 161 162 (defimplementation make-output-stream (write-string) 163 (make-instance 'slime-output-stream :output-fn write-string)) 164 165 (defimplementation make-input-stream (read-string) 166 (make-instance 'slime-input-stream :input-fn read-string)) 164 (defimplementation make-fn-streams (input-fn output-fn) 165 (let* ((output (make-instance 'slime-output-stream 166 :output-fn output-fn)) 167 (input (make-instance 'slime-input-stream 168 :input-fn input-fn 169 :output-stream output))) 170 (values input output))) jasko.tim.lisp/slime/swank-sbcl.lisp
r320 r371 174 174 (:us-ascii "us-ascii" "us-ascii-unix"))) 175 175 176 ;; C.f. R.M.Kreuter in <20536.1219412774@progn.net> on sbcl-general, 2008-08-22.177 (defvar *physical-pathname-host* (pathname-host (user-homedir-pathname)))178 179 (defimplementation parse-emacs-filename (filename)180 (sb-ext:parse-native-namestring filename *physical-pathname-host*))181 182 176 (defimplementation find-external-format (coding-system) 183 177 (car (rassoc-if (lambda (x) (member coding-system x :test #'equal)) … … 436 430 (defvar *trap-load-time-warnings* nil) 437 431 438 (defimplementation swank-compile-file ( pathname load-p external-format)432 (defimplementation swank-compile-file (filename load-p external-format) 439 433 (handler-case 440 434 (let ((output-file (with-compilation-hooks () 441 (compile-file pathname435 (compile-file filename 442 436 :external-format external-format)))) 443 437 (when output-file 444 438 ;; Cache the latest source file for definition-finding. 445 (source-cache-get pathname (file-write-date pathname))439 (source-cache-get filename (file-write-date filename)) 446 440 (when load-p 447 441 (load output-file)))) … … 1327 1321 (return (car tail)))) 1328 1322 (when (eq timeout t) (return (values nil t))) 1329 ;; FIXME: with-timeout doesn't work properly on Darwin1330 #+linux1331 1323 (handler-case (sb-ext:with-timeout 0.2 1332 1324 (sb-thread:condition-wait (mailbox.waitqueue mbox) 1333 1325 mutex)) 1334 (sb-ext:timeout ())) 1335 #-linux 1336 (sb-thread:condition-wait (mailbox.waitqueue mbox) 1337 mutex))))) 1326 (sb-ext:timeout ())))))) 1327 1328 #-non-broken-terminal-sessions 1329 (progn 1330 (defvar *native-wait-for-terminal* #'sb-thread::get-foreground) 1331 (sb-ext:with-unlocked-packages (sb-thread) &n
