relisp 0.9.2 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +6 -0
- data/lib/relisp/slaves.rb +2 -2
- data/lib/relisp.rb +1 -1
- data/tasks/post_load.rake +2 -7
- data/tasks/rdoc.rake +4 -3
- data/tasks/setup.rb +33 -20
- data/test/test_editing_types.rb +14 -10
- metadata +4 -6
- data/src/relisp.elc +0 -0
- data/tasks/manifest.rake +0 -48
data/CHANGELOG
CHANGED
data/lib/relisp/slaves.rb
CHANGED
@@ -324,9 +324,9 @@ module Relisp
|
|
324
324
|
"emacs --batch "
|
325
325
|
end
|
326
326
|
emacs_command << cli_options
|
327
|
-
emacs_command << " -l #{elisp_path}"
|
327
|
+
emacs_command << " -l \"#{elisp_path}\""
|
328
328
|
load_files.each do |file|
|
329
|
-
emacs_command << " -l #{file}"
|
329
|
+
emacs_command << " -l \"#{file}\""
|
330
330
|
end
|
331
331
|
emacs_command << " --eval '(relisp-become-slave)'"
|
332
332
|
# In batch mode, emacs sends its normal output to stderr for
|
data/lib/relisp.rb
CHANGED
data/tasks/post_load.rake
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
# This file does not define any rake tasks. It is used to load some project
|
3
3
|
# settings if they are not defined by the user.
|
4
4
|
|
5
|
-
PROJ.rdoc.exclude << "^#{Regexp.escape(PROJ.manifest_file)}$"
|
6
5
|
PROJ.exclude << ["^#{Regexp.escape(PROJ.ann.file)}$",
|
6
|
+
"^#{Regexp.escape(PROJ.ignore_file)}$",
|
7
7
|
"^#{Regexp.escape(PROJ.rdoc.dir)}/",
|
8
8
|
"^#{Regexp.escape(PROJ.rcov.dir)}/"]
|
9
9
|
|
@@ -25,12 +25,7 @@ PROJ.description ||= paragraphs_of(PROJ.readme_file, 'description').join("\n\n")
|
|
25
25
|
|
26
26
|
PROJ.summary ||= PROJ.description.split('.').first
|
27
27
|
|
28
|
-
PROJ.gem.files ||=
|
29
|
-
if test(?f, PROJ.manifest_file)
|
30
|
-
files = File.readlines(PROJ.manifest_file).map {|fn| fn.chomp.strip}
|
31
|
-
files.delete ''
|
32
|
-
files
|
33
|
-
else [] end
|
28
|
+
PROJ.gem.files ||= manifest
|
34
29
|
|
35
30
|
PROJ.gem.executables ||= PROJ.gem.files.find_all {|fn| fn =~ %r/^bin/}
|
36
31
|
|
data/tasks/rdoc.rake
CHANGED
@@ -19,10 +19,11 @@ namespace :doc do
|
|
19
19
|
end
|
20
20
|
rd.rdoc_files.push(*files)
|
21
21
|
|
22
|
-
|
23
|
-
|
22
|
+
name = PROJ.name
|
24
23
|
rf_name = PROJ.rubyforge.name
|
25
|
-
|
24
|
+
|
25
|
+
title = "#{name}-#{PROJ.version} Documentation"
|
26
|
+
title = "#{rf_name}'s " + title if rf_name.valid? and rf_name != name
|
26
27
|
|
27
28
|
rd.options << "-t #{title}"
|
28
29
|
rd.options.concat(rdoc.opts)
|
data/tasks/setup.rb
CHANGED
@@ -4,8 +4,9 @@ require 'rake'
|
|
4
4
|
require 'rake/clean'
|
5
5
|
require 'fileutils'
|
6
6
|
require 'ostruct'
|
7
|
+
require 'find'
|
7
8
|
|
8
|
-
class OpenStruct; undef :gem; end
|
9
|
+
class OpenStruct; undef :gem if defined? :gem; end
|
9
10
|
|
10
11
|
# TODO: make my own openstruct type object that includes descriptions
|
11
12
|
# TODO: use the descriptions to output help on the available bones options
|
@@ -27,8 +28,8 @@ PROJ = OpenStruct.new(
|
|
27
28
|
:ruby_opts => %w(-w),
|
28
29
|
:libs => [],
|
29
30
|
:history_file => 'History.txt',
|
30
|
-
:manifest_file => 'Manifest.txt',
|
31
31
|
:readme_file => 'README.txt',
|
32
|
+
:ignore_file => '.bnsignore',
|
32
33
|
|
33
34
|
# Announce
|
34
35
|
:ann => OpenStruct.new(
|
@@ -123,9 +124,7 @@ import(*rakefiles)
|
|
123
124
|
%w(lib ext).each {|dir| PROJ.libs << dir if test ?d, dir}
|
124
125
|
|
125
126
|
# Setup some constants
|
126
|
-
|
127
|
-
|
128
|
-
DEV_NULL = WIN32 ? 'NUL:' : '/dev/null'
|
127
|
+
DEV_NULL = File.exist?('/dev/null') ? '/dev/null' : 'NUL:'
|
129
128
|
|
130
129
|
def quiet( &block )
|
131
130
|
io = [STDOUT.dup, STDERR.dup]
|
@@ -138,21 +137,15 @@ ensure
|
|
138
137
|
$stdout, $stderr = STDOUT, STDERR
|
139
138
|
end
|
140
139
|
|
141
|
-
DIFF = if
|
142
|
-
else
|
143
|
-
if quiet {system "gdiff", __FILE__, __FILE__} then 'gdiff'
|
144
|
-
else 'diff' end
|
145
|
-
end unless defined? DIFF
|
140
|
+
DIFF = if system("gdiff '#{__FILE__}' '#{__FILE__}' > #{DEV_NULL} 2>&1") then 'gdiff'
|
141
|
+
else 'diff' end unless defined? DIFF
|
146
142
|
|
147
|
-
SUDO = if
|
148
|
-
else
|
149
|
-
if quiet {system 'which sudo'} then 'sudo'
|
150
|
-
else '' end
|
151
|
-
end
|
143
|
+
SUDO = if system("which sudo > #{DEV_NULL} 2>&1") then 'sudo'
|
144
|
+
else '' end unless defined? SUDO
|
152
145
|
|
153
|
-
RCOV =
|
154
|
-
RDOC =
|
155
|
-
GEM =
|
146
|
+
RCOV = "#{RUBY} -S rcov"
|
147
|
+
RDOC = "#{RUBY} -S rdoc"
|
148
|
+
GEM = "#{RUBY} -S gem"
|
156
149
|
|
157
150
|
%w(rcov spec/rake/spectask rubyforge bones facets/ansicode).each do |lib|
|
158
151
|
begin
|
@@ -254,9 +247,29 @@ end
|
|
254
247
|
# Scans the current working directory and creates a list of files that are
|
255
248
|
# candidates to be in the manifest.
|
256
249
|
#
|
257
|
-
def
|
250
|
+
def manifest
|
258
251
|
files = []
|
259
|
-
exclude =
|
252
|
+
exclude = PROJ.exclude.dup
|
253
|
+
comment = %r/^\s*#/
|
254
|
+
|
255
|
+
# process the ignore file and add the items there to the exclude list
|
256
|
+
if test(?f, PROJ.ignore_file)
|
257
|
+
ary = []
|
258
|
+
File.readlines(PROJ.ignore_file).each do |line|
|
259
|
+
next if line =~ comment
|
260
|
+
line.chomp!
|
261
|
+
line.strip!
|
262
|
+
next if line.nil? or line.empty?
|
263
|
+
|
264
|
+
glob = line =~ %r/\*\./ ? File.join('**', line) : line
|
265
|
+
Dir.glob(glob).each {|fn| ary << "^#{Regexp.escape(fn)}"}
|
266
|
+
end
|
267
|
+
exclude.concat ary
|
268
|
+
end
|
269
|
+
|
270
|
+
# generate a regular expression from the exclude list
|
271
|
+
exclude = Regexp.new(exclude.join('|'))
|
272
|
+
|
260
273
|
Find.find '.' do |path|
|
261
274
|
path.sub! %r/^(\.\/|\/)/o, ''
|
262
275
|
next unless test ?f, path
|
data/test/test_editing_types.rb
CHANGED
@@ -423,9 +423,11 @@ module TestRelisp
|
|
423
423
|
w1.delete_others
|
424
424
|
b = Relisp::Buffer.new(@emacs)
|
425
425
|
w1.buffer=b
|
426
|
+
assert_equal 1, w1.point
|
426
427
|
b.insert "12345"
|
427
428
|
w2 = w1.split
|
428
429
|
w2.select
|
430
|
+
w1.point = 1 # w1 point moves because of insert
|
429
431
|
@emacs.goto_char(@emacs.point_max)
|
430
432
|
assert_equal 6, @emacs.point
|
431
433
|
assert_equal 1, w1.point
|
@@ -494,19 +496,21 @@ module TestRelisp
|
|
494
496
|
end
|
495
497
|
|
496
498
|
def test_initialize
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
499
|
+
# TODO: causes "unknown terminal type" when run in non-window mode
|
500
|
+
# new_frame = Relisp::Frame.new
|
501
|
+
# assert_kind_of Relisp::Frame, new_frame
|
502
|
+
# assert_equal :frame, @emacs.elisp_eval( "(type-of #{new_frame.to_elisp})")
|
503
|
+
# new_frame = Relisp::Frame.new({:width => 30, :height => 20})
|
504
|
+
# assert_kind_of Relisp::Frame, new_frame
|
505
|
+
# assert_equal :frame, @emacs.elisp_eval( "(type-of #{new_frame.to_elisp})")
|
503
506
|
end
|
504
507
|
|
505
508
|
def test_alive_eh
|
506
|
-
|
507
|
-
|
508
|
-
f.
|
509
|
-
|
509
|
+
# TODO: causes "unknown terminal type" when run in non-window mode
|
510
|
+
# f = Relisp::Frame.new
|
511
|
+
# assert f.alive?
|
512
|
+
# f.delete
|
513
|
+
# assert ! f.alive?
|
510
514
|
end
|
511
515
|
end
|
512
516
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: relisp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Don
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-05-05 00:00:00 -04:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - ">="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 2.2
|
23
|
+
version: 2.4.2
|
24
24
|
version:
|
25
25
|
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
26
|
email: don@ohspite.net
|
@@ -49,12 +49,10 @@ files:
|
|
49
49
|
- manual_test/tests.rb
|
50
50
|
- setup.rb
|
51
51
|
- src/relisp.el
|
52
|
-
- src/relisp.elc
|
53
52
|
- tasks/ann.rake
|
54
53
|
- tasks/bones.rake
|
55
54
|
- tasks/gem.rake
|
56
55
|
- tasks/git.rake
|
57
|
-
- tasks/manifest.rake
|
58
56
|
- tasks/notes.rake
|
59
57
|
- tasks/post_load.rake
|
60
58
|
- tasks/rdoc.rake
|
@@ -111,6 +109,6 @@ specification_version: 2
|
|
111
109
|
summary: Call ruby from emacs and call elisp from ruby. If you never did you should. These things are fun and fun is good.
|
112
110
|
test_files:
|
113
111
|
- test/test_editing_types.rb
|
114
|
-
- test/test_programming_types.rb
|
115
112
|
- test/test_elisp_functions.rb
|
113
|
+
- test/test_programming_types.rb
|
116
114
|
- test/test_slaves.rb
|
data/src/relisp.elc
DELETED
Binary file
|
data/tasks/manifest.rake
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
|
2
|
-
require 'find'
|
3
|
-
|
4
|
-
namespace :manifest do
|
5
|
-
|
6
|
-
desc 'Verify the manifest'
|
7
|
-
task :check do
|
8
|
-
fn = PROJ.manifest_file + '.tmp'
|
9
|
-
files = manifest_files
|
10
|
-
|
11
|
-
File.open(fn, 'w') {|fp| fp.puts files}
|
12
|
-
lines = %x(#{DIFF} -du #{PROJ.manifest_file} #{fn}).split("\n")
|
13
|
-
if HAVE_FACETS_ANSICODE and ENV.has_key?('TERM')
|
14
|
-
lines.map! do |line|
|
15
|
-
case line
|
16
|
-
when %r/^(-{3}|\+{3})/; nil
|
17
|
-
when %r/^@/; ANSICode.blue line
|
18
|
-
when %r/^\+/; ANSICode.green line
|
19
|
-
when %r/^\-/; ANSICode.red line
|
20
|
-
else line end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
puts lines.compact
|
24
|
-
rm fn rescue nil
|
25
|
-
end
|
26
|
-
|
27
|
-
desc 'Create a new manifest'
|
28
|
-
task :create do
|
29
|
-
files = manifest_files
|
30
|
-
unless test(?f, PROJ.manifest_file)
|
31
|
-
files << PROJ.manifest_file
|
32
|
-
files.sort!
|
33
|
-
end
|
34
|
-
File.open(PROJ.manifest_file, 'w') {|fp| fp.puts files}
|
35
|
-
end
|
36
|
-
|
37
|
-
task :assert do
|
38
|
-
files = manifest_files
|
39
|
-
manifest = File.read(PROJ.manifest_file).split($/)
|
40
|
-
raise "ERROR: #{PROJ.manifest_file} is out of date" unless files == manifest
|
41
|
-
end
|
42
|
-
|
43
|
-
end # namespace :manifest
|
44
|
-
|
45
|
-
desc 'Alias to manifest:check'
|
46
|
-
task :manifest => 'manifest:check'
|
47
|
-
|
48
|
-
# EOF
|