Changeset 371

Show
Ignore:
Timestamp:
09/17/08 12:41:08 (4 months ago)
Author:
sergey.kol..@gmail.com
Message:

Sergey Kolos:

  • Reverting back to working version of swank. Note to other contributors: please do not update swank until we get release 1.0 out - otherwise we'll be testing and fixing bugs forever.
Files:

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*): Remove 
    4         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 more 
    11         WITH-TIMEOUT related problems. 
    12  
    13         * swank-gray.lisp (slime-input-stream): Remove the output stream 
    14         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 elements 
    19         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 typos 
    30  
    31 2008-08-30  Michael Weber  <michaelw+slime@foldr.org> 
    32  
    33         * swank-backend.lisp (*gray-stream-symbols*): added symbols 
    34         stream-peek-char, stream-read-line, stream-file-position 
    35  
    36 2008-08-30  Mark Evenson <evenson@panix.com> 
    37  
    38         * swank-abcl.lisp (make-output-stream, make-input-stream): provide 
    39         the (trivial) definitions for MAKE-OUTPUT-STREAM and 
    40         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 is 
    45         empty. 
    46  
    47 2008-08-27  Anton Vodonosov <avodonosov@yandex.ru> 
    48  
    49         * swank-ecl.lisp: Add :load-toplevel and :execute to EVAL-WHENs to 
    50         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, which 
    104         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 a 
    121         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 an 
    128         error, because it parsed the asterisk to a wild pathname. Fix 
    129         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): Use 
    135         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* with 
    145         with-connection, for case when the signal hander is called out of 
    146         the blue. 
    147         (swank-debugger-hook): Don't assume that the hook argument is 
    148         #'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 a 
    157         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.  It 
    164         was never used. 
    165         (slime-switch-to-output-buffer-search-all-frames): Deleted. Use 
    166         display-buffer-reuse-frames instead. 
    167         (slime-switch-to-output-buffer): Use pop-to-buffer to select the 
    168         window and frame. 
    169  
    170 2008-08-15  Tobias C. Rittweiler  <tcr@freebits.de> 
    171  
    172         * slime.el (slime-switch-to-output-buffer): Fix regression 
    173         discovered by Ariel Badichi. Programmatic invocation of this 
    174         function expect this function to also set-buffer to the REPL 
    175         buffer. Even though that's ugly, we do it for now, and declare it 
    176         to be a FIXME. 
    177         (slime-dispatch-event): Don't use `message' for the pipelined 
    178         request message, but `slime-display-oneliner' which will truncate 
    179         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 only 
    184         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 of 
    192         the file to stop SBCL from reporting two times the same false 
    193         alarm. 
    194  
    195 2008-08-15  Tobias C. Rittweiler  <tcr@freebits.de> 
    196  
    197         * slime.el (slime-popup-buffer-quit): Fix regression; we have to 
    198         invoke `bury-buffer' without an argument to make it switch buffers 
    199         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 tree 
    204         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 least 
    209         bury the buffer. 
    210         (slime-list-compiler-notes): Shrink the compiler-notes window. 
    211  
    21212008-08-14  Tobias C. Rittweiler  <tcr@freebits.de> 
    2132 
  • 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 the 
    4         length to one line to avoid (some) problems with big or circular 
    5         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-foo 
    14         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  
    2712008-08-12  Helmut Eller  <heller@common-lisp.net> 
    282 
  • jasko.tim.lisp/slime/contrib/slime-fancy.el

    r320 r371  
    8080(slime-package-fu-init) 
    8181 
    82 ;; Fontify with-foo and do-foo like standard macros. 
    83 (require 'slime-fontifying-fu) 
    84 (slime-fontifying-fu-init) 
    85  
    8682(provide 'slime-fancy) 
  • jasko.tim.lisp/slime/contrib/slime-fuzzy.el

    r320 r371  
    360360        (add-hook 'window-configuration-change-hook 
    361361                  '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) 
    363363      (setq buffer-quit-function 'slime-fuzzy-abort)) ; M-Esc Esc 
    364364    (when slime-fuzzy-completion-in-place 
  • jasko.tim.lisp/slime/contrib/slime-indentation.el

    r320 r371  
    10661066                         &body)) 
    10671067          (labels . flet) (macrolet . flet) 
    1068           (if           (&rest 4)) 
     1068          (if           (&rest 2)) 
    10691069          ;; FIXME: Which of those do I really want? 
    10701070          ;; (lambda    ((&whole 4 &rest 1) &body)) 
  • jasko.tim.lisp/slime/contrib/slime-presentations.el

    r320 r371  
    859859              ;; Respect the syntax text properties of presentation. 
    860860              (set (make-local-variable 'parse-sexp-lookup-properties) t) 
    861               (slime-add-local-hook 'after-change-functions  
    862                                     'slime-after-change-function))) 
     861              (add-local-hook 'after-change-functions  
     862                             'slime-after-change-function))) 
    863863  (add-hook 'slime-event-hooks 'slime-dispatch-presentation-event) 
    864864  (setq slime-write-string-function 'slime-presentation-write) 
  • jasko.tim.lisp/slime/contrib/swank-arglists.lisp

    r320 r371  
    477477    (let ((sym (parse-symbol variable-name))) 
    478478      (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))))))) 
    484482 
    485483(defun decode-required-arg (arg) 
  • jasko.tim.lisp/slime/contrib/swank-listener-hooks.lisp

    r320 r371  
    55;; I guess that only Alan Ruttenberg knows how to use this code.  It 
    66;; was in swank.lisp for a long time, so here it is. -- Helmut Eller 
    7  
    8 (in-package :swank) 
    97 
    108(defvar *slime-repl-advance-history* nil  
  • jasko.tim.lisp/slime/metering.lisp

    r320 r371  
    6161;;;                     Purely to cut down on stale code (e.g. #+cltl2) in this 
    6262;;;                     version that is bundled with SLIME. 
    63 ;;; 22-Aug-08 stas      Define TIME-TYPE for Clozure CL. 
     63;;;                      
    6464;;; 
    6565  
     
    401401 
    402402(defconstant time-units-per-second internal-time-units-per-second) 
    403  
    404 #+openmcl 
    405 (progn 
    406  (deftype time-type () 'unsigned-byte) 
    407  (deftype consing-type () 'unsigned-byte)) 
    408403 
    409404(defmacro get-time () 
  • jasko.tim.lisp/slime/slime.el

    r320 r371  
    449449(defun slime-compute-modeline-package () 
    450450  (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)))) 
    455453 
    456454(defun slime-pretty-package-name (name) 
     
    477475(defun slime-compute-modeline-string (conn state pkg) 
    478476  (concat (when (or conn pkg)             "[") 
    479           (when pkg                       (format "PKG:%s" pkg)) 
    480           (when (and (or conn state) pkg) ", ") 
    481477          (when conn                      (format "CON:%s" conn)) 
    482478          (when state                     (format "{%s}" state)) 
     479          (when (and (or conn state) pkg) ", ") 
     480          (when pkg                       (format "PKG:%s" pkg)) 
    483481          (when (or conn pkg)             "]"))) 
    484482 
     
    669667(defun slime-setup-command-hooks () 
    670668  "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)) 
    673671 
    674672  
     
    10451043last activated the buffer." 
    10461044  (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)) 
    10501049    (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)))) 
    10531052 
    10541053(defun slime-popup-buffer-snapshot-unchanged-p () 
     
    10581057(defun slime-popup-buffer-restore-snapshot () 
    10591058  (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 
    10621061 
    10631062;;;;; Filename translation 
     
    22342233          (unless (member tag slime-stack-eval-tags) 
    22352234            (error "Reply to canceled synchronous eval request tag=%S sexp=%S" 
    2236                    tag sexp)) 
     2235                   tag slime-stack-eval-tags sexp)) 
    22372236          (throw tag (list #'identity value))) 
    22382237         ((:abort) 
     
    23322331          ((:emacs-rex form package thread continuation) 
    23332332           (when (and (slime-use-sigint-for-interrupt) (slime-busy-p)) 
    2334              (slime-display-oneliner "; pipelined request... %S" form)) 
     2333             (message "; pipelined request... %S" form)) 
    23352334           (let ((id (incf (slime-continuation-counter)))) 
    23362335             (push (cons id continuation) (slime-rex-continuations)) 
     
    26992698          (set-marker marker (point))))))) 
    27002699 
    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, 
     2702and if found, select that window instead of creating a new one. 
     2703 
     2704If you use multiple screens, you may want to set this to nil such 
     2705that a window on a different screen won't be selected under the 
     2706hood.") 
     2707 
     2708(defun slime-switch-to-output-buffer (&optional connection) 
     2709  "Select the output buffer: If a REPL is already displayed, just 
     2710set focus to that window. Otherwise, try to make a new window 
     2711displaying 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)))) 
    27102725 
    27112726  
     
    28602875  (when slime-repl-history-file 
    28612876    (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)) 
    28642878  (add-hook 'kill-emacs-hook 'slime-repl-save-all-histories) 
    28652879  (slime-setup-command-hooks) 
     
    41624176      (when (null notes) 
    41634177        (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))))) 
    41724182 
    41734183(defun slime-alistify (list key test) 
     
    49544964 
    49554965(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)) 
    49584969 
    49594970(defun slime-complete-forget-window-configuration () 
     
    66626673  ;; Make original slime-connection "sticky" for SLDB commands in this buffer 
    66636674  (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)) 
    66656676 
    66666677(slime-define-keys sldb-mode-map 
     
    67806791      (setq sldb-backtrace-start-marker (point-marker)) 
    67816792      (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)) 
    67856794      (run-hooks 'sldb-hook)) 
    67866795    (pop-to-buffer (current-buffer)) 
     
    71377146  (let ((start (or start (point))) 
    71387147        (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))) 
    71407152 
    71417153(defun sldb-delete-overlays () 
     
    78697881  (slime-eval-describe `(swank:pprint-inspector-part ,part))) 
    78707882 
    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-async  
    7875    `(swank:find-source-location-for-emacs '(:inspector ,part)) 
    7876    #'slime-show-source-location)) 
    7877    
    78787883(defun slime-inspector-reinspect () 
    78797884  (interactive) 
     
    79497954  ([(shift tab)] 'slime-inspector-previous-inspectable-object) ; Emacs translates S-TAB 
    79507955  ([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)) 
    79537957 
    79547958  
     
    84318435  "The name of the buffer used to display test results.") 
    84328436 
    8433 (defvar slime-lisp-under-test nil 
    8434   "The name of Lisp currently executing the tests.") 
    84358437 
    84368438;; dynamically bound during a single test 
     
    92449246                       (not (not (get-buffer-window (current-buffer))))))) 
    92459247 
    9246 (def-slime-test inspector 
    9247     (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  
    92719248(def-slime-test break  
    92729249    (times exp) 
     
    96739650                                ;; Emacs 21 uses microsecs; Emacs 22 millisecs 
    96749651                                (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 focus 
    9679 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 focus 
    9685     (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)))) 
    96979652 
    96989653(slime-defun-if-undefined next-single-char-property-change 
     
    99699924     ,@body)) 
    99709925 
     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 
    99719935  
    99729936;;;; Finishing up 
  • jasko.tim.lisp/slime/swank-abcl.lisp

    r320 r371  
    2525    nil)) 
    2626 
    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))) 
    3331 
    3432(defimplementation call-with-compilation-hooks (function) 
  • jasko.tim.lisp/slime/swank-backend.lisp

    r320 r371  
    204204    :fundamental-character-input-stream 
    205205    :stream-read-char 
    206     :stream-peek-char 
    207     :stream-read-line 
    208     :stream-file-position 
    209206    :stream-listen 
    210207    :stream-unread-char 
     
    373370") 
    374371 
    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. 
    377374If LOAD-P is true, load the file after compilation. 
    378375EXTERNAL-FORMAT is a value returned by find-external-format or 
     
    411408             :accessor location))) 
    412409 
    413 (definterface parse-emacs-filename (filename) 
    414   "Return a PATHNAME for FILENAME. A filename in Emacs may for example 
    415 contain asterisks which should not be translated to wildcards." 
    416   (parse-namestring filename)) 
    417  
    418410(definterface find-external-format (coding-system) 
    419411  "Return a \"external file format designator\" for CODING-SYSTEM. 
     
    424416      nil)) 
    425417 
    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
    428420Return nil if the file contains no special markers." 
    429421  ;; Look for a Emacs-style -*- coding: ... -*- or Local Variable: section. 
    430   (with-open-file (s pathname :if-does-not-exist nil 
     422  (with-open-file (s filename :if-does-not-exist nil 
    431423                     :external-format (or (find-external-format "latin-1-unix") 
    432424                                          :default)) 
     
    462454;;;; Streams 
    463455 
    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. 
     458When input is needed, INPUT-FN is called with no arguments to 
     459return a string. 
     460When output is ready, OUTPUT-FN is called with the output as its 
     461argument. 
     462 
     463Output should be forced to OUTPUT-FN before calling INPUT-FN. 
     464 
     465The streams are returned as two values.") 
    471466 
    472467  
     
    998993 
    999994(definterface all-threads () 
    1000   "Return a fresh list of all threads.") 
     995  "Return a list of all threads.") 
    1001996 
    1002997(definterface thread-alive-p (thread) 
  • jasko.tim.lisp/slime/swank-cmucl.lisp

    r320 r371  
    170170    (let ((old-flags (fcntl fd unix:f-getfl 0))) 
    171171      (fcntl fd unix:f-setfl (logior old-flags unix:fasync))) 
    172     (assert (not (assoc fd *sigio-handlers*))) 
    173172    (push (cons fd fn) *sigio-handlers*))) 
    174173 
    175174(defimplementation remove-sigio-handlers (socket) 
    176175  (let ((fd (socket-fd socket))) 
    177     (when (assoc fd *sigio-handlers*) 
     176    (unless (assoc fd *sigio-handlers*) 
    178177      (setf *sigio-handlers* (remove fd *sigio-handlers* :key #'car)) 
    179178      (let ((old-flags (fcntl fd unix:f-getfl 0))) 
    180179        (fcntl fd unix:f-setfl (logandc2 old-flags unix:fasync))) 
    181180      (sys:invalidate-descriptor fd)) 
    182     (assert (not (assoc fd *sigio-handlers*))
     181    #+(or
    183182    (when (null *sigio-handlers*) 
    184       (sys:default-interrupt :sigio)))) 
     183      (sys:default-interrupt :sigio)) 
     184    )) 
    185185 
    186186;;;;; SERVE-EVENT 
     
    197197;;; XXX: How come we don't use Gray streams in CMUCL too? -luke (15/May/2004) 
    198198 
    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))) 
    204203 
    205204(defstruct (slime-output-stream 
     
    294293             (:conc-name sis.) 
    295294             (:print-function %print-slime-output-stream) 
    296              (:constructor make-slime-input-stream (input-fn))) 
     295             (:constructor make-slime-input-stream (input-fn sos))) 
    297296  (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) 
    298300  (buffer   ""  :type string) 
    299301  (index    0   :type kernel:index)) 
    300302 
    301303(defun sis/in (stream eof-errorp eof-value) 
     304  (finish-output (sis.sos stream)) 
    302305  (let ((index (sis.index stream)) 
    303306        (buffer (sis.buffer stream))) 
     
    22862289    (let ((code (alien:alien-funcall  
    22872290                 (alien:extern-alien  
    2288                   waitpid (alien:function c-call:int c-call:int 
     2291                  waitpid (alien:function unix::pid-t  
     2292                                          unix::pid-t 
    22892293                                          (* c-call:int) c-call:int)) 
    22902294                 pid (alien:addr status) 0))) 
  • jasko.tim.lisp/slime/swank-ecl.lisp

    r320 r371  
    1313(defvar *tmp*) 
    1414 
    15 (eval-when (:compile-toplevel :load-toplevel :execute) 
    1615(if (find-package :gray) 
    1716  (import-from :gray *gray-stream-symbols* :swank-backend) 
     
    2322   :generic-function-declarations 
    2423   :specializer-direct-methods 
    25    :compute-applicable-methods-using-classes))) 
     24   :compute-applicable-methods-using-classes)) 
    2625 
    2726  
    2827;;;; TCP Server 
    2928 
    30 (eval-when (:compile-toplevel :load-toplevel :execute) 
    31   (require 'sockets)) 
     29(require 'sockets) 
    3230 
    3331(defun resolve-hostname (name) 
     
    221219;;; Debugging 
    222220 
    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)) 
    241238 
    242239(defvar *backtrace* '()) 
  • jasko.tim.lisp/slime/swank-gray.lisp

    r320 r371  
    7878 
    7979(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) 
    8182   (buffer :initform "") (index :initform 0) 
    8283   (lock :initform (make-lock :name "buffer read lock")))) 
     
    8687   (slot-value s 'lock) 
    8788   (lambda () 
    88      (with-slots (buffer index input-fn) s 
     89     (with-slots (buffer index output-stream input-fn) s 
    8990       (when (= index (length buffer)) 
     91         (when output-stream 
     92           (finish-output output-stream)) 
    9093         (let ((string (funcall input-fn))) 
    9194           (cond ((zerop (length string)) 
     
    159162  
    160163;;; 
    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  
    174174    (:us-ascii "us-ascii" "us-ascii-unix"))) 
    175175 
    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  
    182176(defimplementation find-external-format (coding-system) 
    183177  (car (rassoc-if (lambda (x) (member coding-system x :test #'equal)) 
     
    436430(defvar *trap-load-time-warnings* nil) 
    437431 
    438 (defimplementation swank-compile-file (pathname load-p external-format) 
     432(defimplementation swank-compile-file (filename load-p external-format) 
    439433  (handler-case 
    440434      (let ((output-file (with-compilation-hooks () 
    441                            (compile-file pathname  
     435                           (compile-file filename  
    442436                                         :external-format external-format)))) 
    443437        (when output-file 
    444438          ;; 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)) 
    446440          (when load-p 
    447441            (load output-file)))) 
     
    13271321             (return (car tail)))) 
    13281322         (when (eq timeout t) (return (values nil t))) 
    1329          ;; FIXME: with-timeout doesn't work properly on Darwin 
    1330          #+linux 
    13311323         (handler-case (sb-ext:with-timeout 0.2 
    13321324                         (sb-thread:condition-wait (mailbox.waitqueue mbox) 
    13331325                                                   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