~scymtym/rudel/remote-exec

« back to all changes in this revision

Viewing changes to remote-modes/rudel-remote-modes-slime.el

  • Committer: scymtym
  • Date: 2010-07-22 02:00:44 UTC
  • Revision ID: scymtym@users.sourceforge.net-20100722020044-viubrbbfxwyd3gy6
Added remote modes for slime, eshell and comint
* remote-modes/rudel-remote-modes-util.el: new file; utility
  functions for remote command execution and remote mode definition
* remote-modes/rudel-remote-modes-slime.el: new file; remote slime
  repl mode
* remote-modes/rudel-remote-modes-eshell.el: new file; remote
  eshell mode
* remote-modes/rudel-remote-modes-comint.el: new file; remote
  comint mode
* remote-modes/Project.ede: new file; project file for
  remote-modes directory
* Project.ede (target autoloads): added remote-modes directory

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
;;; rudel-remote-modes-slime.el ---
 
2
;;
 
3
;; Copyright (C) 2010 Jan Moringen
 
4
;;
 
5
;; Author: Jan Moringen <scymtym@users.sourceforge.net>
 
6
;; Keywords: rudel, remote mode, slime
 
7
;;
 
8
;; This file is part of Rudel.
 
9
;;
 
10
;; Rudel is free software: you can redistribute it and/or modify it
 
11
;; under the terms of the GNU General Public License as published by
 
12
;; the Free Software Foundation, either version 3 of the License, or
 
13
;; (at your option) any later version.
 
14
;;
 
15
;; Rudel is distributed in the hope that it will be useful, but
 
16
;; WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 
18
;; General Public License for more details.
 
19
;;
 
20
;; You should have received a copy of the GNU General Public License
 
21
;; along with Rudel. If not, see <http://www.gnu.org/licenses>.
 
22
 
 
23
 
 
24
;;; Commentary:
 
25
;;
 
26
 
 
27
 
 
28
;;; History:
 
29
;;
 
30
;; 0.1 - Initial version
 
31
 
 
32
 
 
33
;;; Code:
 
34
;;
 
35
 
 
36
(require 'slime)
 
37
(require 'slime-repl)
 
38
 
 
39
(require 'rudel-remote-modes-util)
 
40
 
 
41
 
 
42
;;; Function List and Mode Definition
 
43
;;
 
44
 
 
45
(defvar rudel-remote-modes-slime-repl-functions
 
46
  `((,(kbd "RET") slime-repl-return)
 
47
    (,(kbd "M-p") slime-repl-previous-input)
 
48
    (,(kbd "M-n") slime-repl-next-input))
 
49
  "")
 
50
 
 
51
(rudel-remote-modes-util-define-remote-mode
 
52
    slime-repl-mode "REPL"
 
53
  rudel-remote-modes-slime-repl-functions)
 
54
 
 
55
 
 
56
;;; Unit Tests
 
57
;;
 
58
 
 
59
(eval-when-compile
 
60
  (when (require 'ert nil t)
 
61
 
 
62
    (require 'rudel-test-remote)
 
63
 
 
64
    (ert-deftest rudel-remote-modes-slime-test-smoke ()
 
65
      "Smoke test for remote slime stuff."
 
66
 
 
67
      (rudel-test-remote-with-emacs-processes
 
68
          (client server)
 
69
 
 
70
        (rudel-test-in-emacs server
 
71
          (require 'rudel-loaddefs)
 
72
          (require 'rudel-debug)
 
73
          (require 'rudel-remote-modes-slime)
 
74
 
 
75
          (global-rudel-minor-mode)
 
76
          (rudel-host-session
 
77
           (rudel-session-initiation-adjust-info
 
78
            (list :protocol-backend  'obby
 
79
                  :transport-backend 'tcp
 
80
                  :port              6522)))
 
81
          (rudel-join-session
 
82
           (rudel-session-initiation-adjust-info
 
83
            (list :protocol-backend  'obby
 
84
                  :transport-backend 'tcp
 
85
                  :host              "localhost"
 
86
                  :port              6522
 
87
                  :encryption        nil
 
88
                  :username          "jan"
 
89
                  :color             "red"
 
90
                  :global-password   nil
 
91
                  :user-password     nil)))
 
92
          (rudel-remote-exec-register-data-handler)
 
93
          (slime)
 
94
          (rudel-publish-buffer (current-buffer))
 
95
          nil)
 
96
 
 
97
        (rudel-test-in-emacs client
 
98
          (require 'rudel-loaddefs)
 
99
          (require 'rudel-debug)
 
100
          (require 'rudel-remote-modes-slime)
 
101
 
 
102
          (global-rudel-minor-mode)
 
103
          (rudel-join-session
 
104
           (rudel-session-initiation-adjust-info
 
105
            (list :protocol-backend  'obby
 
106
                  :transport-backend 'tcp
 
107
                  :host              "localhost"
 
108
                  :port              6522
 
109
                  :encryption        nil
 
110
                  :username          "jan2"
 
111
                  :color             "blue"
 
112
                  :global-password   nil
 
113
                  :user-password     nil)))
 
114
          (rudel-remote-exec-register-data-handler)
 
115
          (rudel-subscribe (car (oref rudel-current-session :documents)))
 
116
          ;;(pop-to-buffer "name?")
 
117
          (remote-slime-mode)
 
118
          nil)
 
119
 
 
120
        ))
 
121
 
 
122
    ))
 
123
 
 
124
(provide 'rudel-remote-modes-slime)
 
125
;;; rudel-remote-modes-slime.el ends here