relisp 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,3 +1,15 @@
1
+ == 1.0.1 / 2009-09-09
2
+
3
+ * 1 tiny backwards-incompatible enhancement
4
+ * 'relisp-start-slave' now takes an optional argument for the path
5
+ to the ruby script, instead of relying on the variable
6
+ 'relisp-ruby-slave-path'. That was stupid.
7
+ * 1 minor change
8
+ * Better instructions for installing elisp component.
9
+ * 2 bug fixes
10
+ * Relisp::Window#shrink
11
+ * Relisp::Window#enlarge
12
+
1
13
  == 1.0.0 / 2009-05-05
2
14
 
3
15
  * Works on Windows
data/README CHANGED
@@ -19,8 +19,12 @@ Then the library is installed, and you can call elisp from ruby. But
19
19
  if you want to call ruby from emacs (and you do, right?) you need to
20
20
  go into the +src+ directory and copy <tt>relisp.el</tt> and/or
21
21
  <tt>relisp.elc</tt> to your elisp folder (probably <tt>~/.elisp</tt>).
22
- Then you might want to add the line <tt>(require 'relisp)</tt> to your
23
- emacs initialization file (probably <tt>~/.emacs'</tt>).
22
+ Then you might want to add the lines
23
+
24
+ (autoload 'relisp-start-slave "relisp" nil t)
25
+ (autoload 'ruby-eval "relisp" nil t)
26
+
27
+ to your emacs initialization file (probably <tt>~/.emacs'</tt>).
24
28
 
25
29
  If you don't know where to find the files for this gem, run the
26
30
  command <tt>gem env gemdir</tt>. Or you can download the tarball for
@@ -92,12 +96,11 @@ The ruby slave file should look something like this:
92
96
  slave.start
93
97
 
94
98
  The call to <tt>slave.start</tt> should probably be the last line of
95
- the file since it starts an infinite loop. The elisp code just
96
- needs to specify the ruby slave file before calling
99
+ the file since it starts an infinite loop. The elisp code just needs
100
+ to specify the path to the ruby slave when calling
97
101
  <tt>relisp-start-slave</tt>:
98
102
 
99
- (setq relisp-ruby-slave-path "ruby_slave")
100
- (relisp-start-slave)
103
+ (relisp-start-slave "ruby_slave")
101
104
  (ruby-eval "sample_ruby_method")
102
105
 
103
106
  For debugging and curiousity, all of the messages between emacs and
@@ -142,10 +145,6 @@ use the <tt>ElispSlave#debugging</tt> method:
142
145
  emacs.elisp_eval "(+ 1 2)"
143
146
  end
144
147
 
145
- == To Do
146
-
147
- * fix Windows bug(s)
148
-
149
148
  == Author
150
149
 
151
150
  <don@ohspite.net>
data/Rakefile CHANGED
@@ -1,35 +1,30 @@
1
1
  begin
2
2
  require 'bones'
3
- Bones.setup
4
3
  rescue LoadError
5
- begin
6
- load 'tasks/setup.rb'
7
- rescue LoadError
8
- raise RuntimeError, '### please install the "bones" gem ###'
9
- end
4
+ raise RuntimeError, '### please install the "bones" gem ###'
10
5
  end
11
6
 
7
+ task :default => 'test:run'
12
8
  ensure_in_path 'lib'
13
9
  require 'relisp'
14
10
 
15
- task :default => 'test'
16
-
17
- PROJ.name = 'relisp'
18
- PROJ.authors = 'Don'
19
- PROJ.email = 'don@ohspite.net'
20
- PROJ.url = 'relisp.rubyforge.org'
21
- PROJ.summary = 'Call ruby from emacs and call elisp from ruby. If you never did you should. These things are fun and fun is good.'
22
- PROJ.description = 'Call ruby from emacs and call elisp from ruby. If you never did you should. These things are fun and fun is good.'
23
- PROJ.version = Relisp::VERSION
24
- PROJ.rubyforge.name = 'relisp'
25
- PROJ.history_file = 'CHANGELOG'
26
- PROJ.manifest_file = 'Manifest'
27
- PROJ.readme_file = 'README'
28
- PROJ.rdoc.main = 'README'
29
- PROJ.exclude = %w(tmp$ bak$ ~$ CVS \.svn/ \.git/ \.bzr/ \.bzrignore ^pkg/)
30
- PROJ.rdoc.include = %w(README ^lib/ ^bin/ ^ext/ \.txt$ \.rdoc$)
31
-
32
- PROJ.gem.extras[:post_install_message] = <<-MSG
11
+ Bones do
12
+ name 'relisp'
13
+ authors 'Don'
14
+ email 'don@ohspite.net'
15
+ url 'https://rubygems.org/gems/relisp'
16
+ summary 'Call ruby from emacs and call elisp from ruby. If you never did you should. These things are fun and fun is good.'
17
+ description 'Call ruby from emacs and call elisp from ruby. If you never did you should. These things are fun and fun is good.'
18
+ version Relisp::VERSION
19
+ # rubyforge.name 'relisp'
20
+ history_file 'CHANGELOG'
21
+ manifest_file 'Manifest'
22
+ readme_file 'README'
23
+ rdoc.main 'README'
24
+ exclude %w(tmp$ bak$ ~$ CVS \.svn/ \.git/ \.bzr/ \.bzrignore ^pkg/)
25
+ rdoc.include %w(README ^lib/ ^bin/ ^ext/ \.txt$ \.rdoc$)
26
+
27
+ gem.extras[:post_install_message] = <<-MSG
33
28
  ---------------------------
34
29
  Wait! You're not finished!
35
30
 
@@ -37,8 +32,12 @@ The gem is installed, and you can now call elisp from ruby. But if
37
32
  you want to call ruby from emacs (and you do, right?) you need to go
38
33
  into the 'src' directory of this gem and copy 'relisp.el' and/or
39
34
  'relisp.elc' to your elisp folder (probably '~/.elisp'). Then you
40
- might want to add the line "(require 'relisp)" to your emacs
41
- initialization file (probably '~/.emacs').
35
+ might want to add the lines
36
+
37
+ (autoload 'relisp-start-slave "relisp" nil t)
38
+ (autoload 'ruby-eval "relisp" nil t)
39
+
40
+ to your emacs initialization file (probably '~/.emacs').
42
41
 
43
42
  If you don't know where to find the files for this gem, run the
44
43
  command "gem env gemdir". Or you can download the tarball for this
@@ -46,5 +45,5 @@ gem and get the files there.
46
45
  ---------------------------
47
46
  MSG
48
47
 
49
- PROJ.spec.opts << '--color'
50
-
48
+ # spec.opts << '--color'
49
+ end
@@ -1,27 +1,21 @@
1
1
  ;; How to specify a file when running the slave. The next few
2
2
  ;; `ruby-eval's call methods defined in the ruby slave file.
3
3
 
4
- (progn
5
- (relisp-stop-slave)
6
- (setq relisp-ruby-slave-path "ruby_slave")
7
- (relisp-start-slave))
4
+ (relisp-start-slave "ruby_slave")
8
5
 
9
6
  (ruby-eval "sample_ruby_method1")
10
7
  (ruby-eval "sample_ruby_method2")
11
8
 
12
- (member "ruby-created-buffer" (mapcar (lambda (a) (buffer-name a)) (buffer-list)))
9
+ (member "ruby-created-buffer" (mapcar 'buffer-name (buffer-list)))
13
10
  (ruby-exec "sample_ruby_method3")
14
- (member "ruby-created-buffer" (mapcar (lambda (a) (buffer-name a)) (buffer-list)))
11
+ (member "ruby-created-buffer" (mapcar 'buffer-name (buffer-list)))
15
12
 
16
13
  (ruby-exec "sample_ruby_method4")
17
14
 
18
15
  ;; How to start the ruby slave without a file. The rest of the
19
16
  ;; commands will work fine with a slave started either way.
20
17
 
21
- (progn
22
- (relisp-stop-slave)
23
- (makunbound 'relisp-ruby-slave-path)
24
- (relisp-start-slave))
18
+ (relisp-start-slave) ;; stops the old slave first
25
19
 
26
20
  ;; Basic functionality--note that return values are not strings but
27
21
  ;; actual elisp data types:
@@ -35,14 +29,14 @@
35
29
  (type-of (ruby-eval (concat (relisp-to-ruby vect) ".reverse")))
36
30
 
37
31
  (setq list '(3 5 2 6 4 1))
38
- (ruby-eval (concat (relisp-to-ruby list) ".sort"))
39
- (type-of (ruby-eval (concat (relisp-to-ruby list) ".sort")))
32
+ (ruby-eval (concat (relisp-to-ruby list) ".class"))
33
+ (ruby-eval (concat (relisp-to-ruby list) ".to_list.class"))
34
+ (ruby-eval (concat (relisp-to-ruby list) ".to_list.sort"))
35
+ (type-of (ruby-eval (concat (relisp-to-ruby list) ".to_list")))
40
36
 
41
37
  (setq str "a couple of words")
42
38
  (ruby-eval (concat (relisp-to-ruby str) ".split"))
43
39
 
44
- (type-of (ruby-eval "{:name => 'john'}"))
45
-
46
40
  ;; Recursive calls:
47
41
  (ruby-eval "elisp_eval('(+ 1 2)')")
48
42
  (ruby-eval "elisp_eval('(ruby-eval \"1 + 2\")')")
@@ -463,13 +463,13 @@ module Relisp
463
463
  end
464
464
 
465
465
  def enlarge(vertical, horizontal=0)
466
- eval_in_window "(enlarge-window #{vertical.to_elisp})"
467
- eval_in_window "(enlarge-window-horizontally #{horizontal.to_elisp})"
466
+ eval_in_window "(enlarge-window #{vertical.to_elisp})" unless vertical == 0
467
+ eval_in_window "(enlarge-window-horizontally #{horizontal.to_elisp})" unless horizontal == 0
468
468
  end
469
469
 
470
470
  def shrink(vertical, horizontal=0)
471
- eval_in_window "(shrink-window #{vertical.to_elisp})"
472
- eval_in_window "(shrink-window-horizontally #{horizontal.to_elisp})"
471
+ eval_in_window "(shrink-window #{vertical.to_elisp})" unless vertical == 0
472
+ eval_in_window "(shrink-window-horizontally #{horizontal.to_elisp})" unless horizontal == 0
473
473
  end
474
474
 
475
475
  def frame
@@ -265,7 +265,7 @@ module Relisp
265
265
  end
266
266
 
267
267
  # Translate the cons cell into a Relisp::List, a subclass of
268
- # Array. See list? for when this be done.
268
+ # Array. See list? for when this can be done.
269
269
  #
270
270
  def to_list
271
271
  list_array = []
data/lib/relisp.rb CHANGED
@@ -19,7 +19,7 @@
19
19
  #++
20
20
 
21
21
  module Relisp
22
- VERSION = '1.0.0'
22
+ VERSION = '1.0.1'
23
23
 
24
24
  class ElispError < RuntimeError; end
25
25
  end
data/manual_test/tests.el CHANGED
@@ -1,7 +1,4 @@
1
- (progn
2
- (relisp-stop-slave)
3
- (setq relisp-ruby-slave-path "tests.rb")
4
- (relisp-start-slave))
1
+ (relisp-start-slave "tests.rb")
5
2
 
6
3
  ;; bury current buffer
7
4
  (ruby-eval "buffer_bury")
@@ -21,52 +18,3 @@
21
18
 
22
19
  ;; create some windows and move them horizontally and vertically
23
20
  (ruby-eval "window_shrink")
24
-
25
-
26
-
27
-
28
-
29
-
30
-
31
-
32
-
33
-
34
-
35
-
36
-
37
-
38
-
39
-
40
-
41
-
42
-
43
-
44
-
45
-
46
-
47
-
48
-
49
-
50
-
51
-
52
-
53
-
54
-
55
-
56
-
57
-
58
-
59
-
60
-
61
-
62
-
63
-
64
-
65
-
66
-
67
-
68
-
69
-
70
-
71
-
72
-
data/manual_test/tests.rb CHANGED
@@ -31,7 +31,6 @@ def window_scroll_down
31
31
  selected_window.visible?(1)
32
32
  end
33
33
 
34
-
35
34
  def window_shrink
36
35
  w = selected_window
37
36
  w2 = w.split_vertically
@@ -61,6 +60,5 @@ def window_shrink
61
60
  w3.delete
62
61
  end
63
62
 
64
-
65
63
  slave.start
66
64
 
data/src/relisp.el CHANGED
@@ -134,7 +134,7 @@
134
134
  "Have ruby evaluate RUBY-CODE without returning the result.
135
135
  Reads input from the minibuffer unless an argument is
136
136
  given."
137
- (interactive "ruby> ")
137
+ (interactive "Mruby> ")
138
138
  (let (message result)
139
139
  (if (and relisp-emacs-master-p (not (relisp-slave-alive-p)))
140
140
  (relisp-start-slave))
@@ -155,7 +155,7 @@ given."
155
155
  The result is an elisp object equivalent to the ruby result of
156
156
  RUBY-CODE. Reads input from the minibuffer unless an argument is
157
157
  given."
158
- (interactive "ruby> ")
158
+ (interactive "Mruby> ")
159
159
  (let (message result)
160
160
  (if (and relisp-emacs-master-p (not (relisp-slave-alive-p)))
161
161
  (relisp-start-slave))
@@ -254,17 +254,17 @@ relisp-become-slave."
254
254
  (setq relisp-error-code (relisp-get-constant))
255
255
  (setq relisp-previous-result (read (relisp-get-constant))))
256
256
 
257
- (defun relisp-start-slave nil
257
+ (defun relisp-start-slave (&optional slave-path)
258
258
  "Start a ruby slave process to do emacs's bidding.
259
- If `relisp-ruby-slave-path' is bound, then that file is read and
260
- the Relisp::RubySlave object must be started there. Otherwise
259
+ If SLAVE-PATH is given, then that Ruby file is read and the
260
+ Relisp::RubySlave object must be started in that file. Otherwise
261
261
  emacs starts a ruby process and starts a RubySlave on its own."
262
262
  (interactive)
263
263
  (setq relisp-emacs-master-p t)
264
264
  (relisp-stop-slave)
265
265
  (setq relisp-ruby-output "")
266
- (if (and (boundp 'relisp-ruby-slave-path) (file-exists-p relisp-ruby-slave-path))
267
- (setq relisp-slave-process (start-process relisp-slave-name nil "ruby" relisp-ruby-slave-path))
266
+ (if (and slave-path (file-exists-p slave-path))
267
+ (setq relisp-slave-process (start-process relisp-slave-name nil "ruby" slave-path))
268
268
  (setq relisp-slave-process (start-process relisp-slave-name nil
269
269
  "ruby"
270
270
  "-x"))
@@ -303,6 +303,7 @@ emacs starts a ruby process and starts a RubySlave on its own."
303
303
 
304
304
  (defun relisp-stop-slave nil
305
305
  "Kill the ruby slave process."
306
+ (interactive)
306
307
  (if (boundp 'relisp-slave-process)
307
308
  (delete-process relisp-slave-process)))
308
309
 
metadata CHANGED
@@ -1,7 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relisp
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ hash: 21
5
+ prerelease: false
6
+ segments:
7
+ - 1
8
+ - 0
9
+ - 1
10
+ version: 1.0.1
5
11
  platform: ruby
6
12
  authors:
7
13
  - Don
@@ -9,19 +15,25 @@ autorequire:
9
15
  bindir: bin
10
16
  cert_chain: []
11
17
 
12
- date: 2009-05-05 00:00:00 -04:00
18
+ date: 2010-12-31 00:00:00 -05:00
13
19
  default_executable:
14
20
  dependencies:
15
21
  - !ruby/object:Gem::Dependency
16
22
  name: bones
17
- type: :development
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
23
+ prerelease: false
24
+ requirement: &id001 !ruby/object:Gem::Requirement
25
+ none: false
20
26
  requirements:
21
27
  - - ">="
22
28
  - !ruby/object:Gem::Version
23
- version: 2.4.2
24
- version:
29
+ hash: 27
30
+ segments:
31
+ - 3
32
+ - 5
33
+ - 4
34
+ version: 3.5.4
35
+ type: :development
36
+ version_requirements: *id001
25
37
  description: Call ruby from emacs and call elisp from ruby. If you never did you should. These things are fun and fun is good.
26
38
  email: don@ohspite.net
27
39
  executables: []
@@ -49,24 +61,14 @@ files:
49
61
  - manual_test/tests.rb
50
62
  - setup.rb
51
63
  - src/relisp.el
52
- - tasks/ann.rake
53
- - tasks/bones.rake
54
- - tasks/gem.rake
55
- - tasks/git.rake
56
- - tasks/notes.rake
57
- - tasks/post_load.rake
58
- - tasks/rdoc.rake
59
- - tasks/rubyforge.rake
60
- - tasks/setup.rb
61
- - tasks/spec.rake
62
- - tasks/svn.rake
63
- - tasks/test.rake
64
64
  - test/test_editing_types.rb
65
65
  - test/test_elisp_functions.rb
66
66
  - test/test_programming_types.rb
67
67
  - test/test_slaves.rb
68
68
  has_rdoc: true
69
- homepage: relisp.rubyforge.org
69
+ homepage: https://rubygems.org/gems/relisp
70
+ licenses: []
71
+
70
72
  post_install_message: |
71
73
  ---------------------------
72
74
  Wait! You're not finished!
@@ -75,8 +77,12 @@ post_install_message: |
75
77
  you want to call ruby from emacs (and you do, right?) you need to go
76
78
  into the 'src' directory of this gem and copy 'relisp.el' and/or
77
79
  'relisp.elc' to your elisp folder (probably '~/.elisp'). Then you
78
- might want to add the line "(require 'relisp)" to your emacs
79
- initialization file (probably '~/.emacs').
80
+ might want to add the lines
81
+
82
+ (autoload 'relisp-start-slave "relisp" nil t)
83
+ (autoload 'ruby-eval "relisp" nil t)
84
+
85
+ to your emacs initialization file (probably '~/.emacs').
80
86
 
81
87
  If you don't know where to find the files for this gem, run the
82
88
  command "gem env gemdir". Or you can download the tarball for this
@@ -89,26 +95,32 @@ rdoc_options:
89
95
  require_paths:
90
96
  - lib
91
97
  required_ruby_version: !ruby/object:Gem::Requirement
98
+ none: false
92
99
  requirements:
93
100
  - - ">="
94
101
  - !ruby/object:Gem::Version
102
+ hash: 3
103
+ segments:
104
+ - 0
95
105
  version: "0"
96
- version:
97
106
  required_rubygems_version: !ruby/object:Gem::Requirement
107
+ none: false
98
108
  requirements:
99
109
  - - ">="
100
110
  - !ruby/object:Gem::Version
111
+ hash: 3
112
+ segments:
113
+ - 0
101
114
  version: "0"
102
- version:
103
115
  requirements: []
104
116
 
105
117
  rubyforge_project: relisp
106
- rubygems_version: 1.3.1
118
+ rubygems_version: 1.3.7
107
119
  signing_key:
108
- specification_version: 2
120
+ specification_version: 3
109
121
  summary: Call ruby from emacs and call elisp from ruby. If you never did you should. These things are fun and fun is good.
110
122
  test_files:
111
123
  - test/test_editing_types.rb
112
- - test/test_elisp_functions.rb
113
- - test/test_programming_types.rb
114
124
  - test/test_slaves.rb
125
+ - test/test_programming_types.rb
126
+ - test/test_elisp_functions.rb
data/tasks/ann.rake DELETED
@@ -1,80 +0,0 @@
1
-
2
- begin
3
- require 'bones/smtp_tls'
4
- rescue LoadError
5
- require 'net/smtp'
6
- end
7
- require 'time'
8
-
9
- namespace :ann do
10
-
11
- # A prerequisites task that all other tasks depend upon
12
- task :prereqs
13
-
14
- file PROJ.ann.file do
15
- ann = PROJ.ann
16
- puts "Generating #{ann.file}"
17
- File.open(ann.file,'w') do |fd|
18
- fd.puts("#{PROJ.name} version #{PROJ.version}")
19
- fd.puts(" by #{Array(PROJ.authors).first}") if PROJ.authors
20
- fd.puts(" #{PROJ.url}") if PROJ.url.valid?
21
- fd.puts(" (the \"#{PROJ.release_name}\" release)") if PROJ.release_name
22
- fd.puts
23
- fd.puts("== DESCRIPTION")
24
- fd.puts
25
- fd.puts(PROJ.description)
26
- fd.puts
27
- fd.puts(PROJ.changes.sub(%r/^.*$/, '== CHANGES'))
28
- fd.puts
29
- ann.paragraphs.each do |p|
30
- fd.puts "== #{p.upcase}"
31
- fd.puts
32
- fd.puts paragraphs_of(PROJ.readme_file, p).join("\n\n")
33
- fd.puts
34
- end
35
- fd.puts ann.text if ann.text
36
- end
37
- end
38
-
39
- desc "Create an announcement file"
40
- task :announcement => ['ann:prereqs', PROJ.ann.file]
41
-
42
- desc "Send an email announcement"
43
- task :email => ['ann:prereqs', PROJ.ann.file] do
44
- ann = PROJ.ann
45
- from = ann.email[:from] || Array(PROJ.authors).first || PROJ.email
46
- to = Array(ann.email[:to])
47
-
48
- ### build a mail header for RFC 822
49
- rfc822msg = "From: #{from}\n"
50
- rfc822msg << "To: #{to.join(',')}\n"
51
- rfc822msg << "Subject: [ANN] #{PROJ.name} #{PROJ.version}"
52
- rfc822msg << " (#{PROJ.release_name})" if PROJ.release_name
53
- rfc822msg << "\n"
54
- rfc822msg << "Date: #{Time.new.rfc822}\n"
55
- rfc822msg << "Message-Id: "
56
- rfc822msg << "<#{"%.8f" % Time.now.to_f}@#{ann.email[:domain]}>\n\n"
57
- rfc822msg << File.read(ann.file)
58
-
59
- params = [:server, :port, :domain, :acct, :passwd, :authtype].map do |key|
60
- ann.email[key]
61
- end
62
-
63
- params[3] = PROJ.email if params[3].nil?
64
-
65
- if params[4].nil?
66
- STDOUT.write "Please enter your e-mail password (#{params[3]}): "
67
- params[4] = STDIN.gets.chomp
68
- end
69
-
70
- ### send email
71
- Net::SMTP.start(*params) {|smtp| smtp.sendmail(rfc822msg, from, to)}
72
- end
73
- end # namespace :ann
74
-
75
- desc 'Alias to ann:announcement'
76
- task :ann => 'ann:announcement'
77
-
78
- CLOBBER << PROJ.ann.file
79
-
80
- # EOF
data/tasks/bones.rake DELETED
@@ -1,20 +0,0 @@
1
-
2
- if HAVE_BONES
3
-
4
- namespace :bones do
5
-
6
- desc 'Show the PROJ open struct'
7
- task :debug do |t|
8
- atr = if t.application.top_level_tasks.length == 2
9
- t.application.top_level_tasks.pop
10
- end
11
-
12
- if atr then Bones::Debug.show_attr(PROJ, atr)
13
- else Bones::Debug.show PROJ end
14
- end
15
-
16
- end # namespace :bones
17
-
18
- end # HAVE_BONES
19
-
20
- # EOF