summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2007-02-20 12:00:00 +0100
committerHans Hagen <pragma@wxs.nl>2007-02-20 12:00:00 +0100
commitae7756295182e4a03b95a7ae8a0c7ba6e74f85b6 (patch)
treed4143b14c39d3d1f965c354e63b35858111158db /scripts
parent8cb3c59f58c0d69f99c451485eaabcb9f5347372 (diff)
downloadcontext-ae7756295182e4a03b95a7ae8a0c7ba6e74f85b6.tar.gz
stable 2007.02.20 12:00
Diffstat (limited to 'scripts')
-rw-r--r--scripts/context/lua/scite-ctx.lua3
-rw-r--r--scripts/context/ruby/base/tex.rb5
-rw-r--r--scripts/context/ruby/base/tool.rb4
-rw-r--r--scripts/context/ruby/concheck.rb2
-rw-r--r--scripts/context/ruby/ctxtools.rb9
-rw-r--r--scripts/context/ruby/graphics/gs.rb7
-rw-r--r--scripts/context/ruby/pstopdf.rb2
-rw-r--r--scripts/context/ruby/wwwserver.rb2
-rw-r--r--scripts/context/ruby/xmltools.rb22
9 files changed, 35 insertions, 21 deletions
diff --git a/scripts/context/lua/scite-ctx.lua b/scripts/context/lua/scite-ctx.lua
index 5836bcbfb..82f8599b1 100644
--- a/scripts/context/lua/scite-ctx.lua
+++ b/scripts/context/lua/scite-ctx.lua
@@ -330,7 +330,6 @@ function wrap_text()
local endcolumn = props['SelectionEndColumn'] - 1
local indentation = string.rep(' ', startcolumn)
--- local selection = string.gsub(editor:GetSelText(),"[\n\r][\n\r]+", ' ' .. magicstring .. ' ')
local selection = string.gsub(editor:GetSelText(),"[\n\r][\n\r]", "\n")
local selection = string.gsub(selection,"\n\n+", ' ' .. magicstring .. ' ')
local replacement = ''
@@ -348,7 +347,7 @@ function wrap_text()
elseif string.len(templine) == 0 then
templine = indentation .. snippet
else
- templine = templine .. ' ' .. snippet
+ templine = string.len(templine) .. ' ' .. snippet
end
end
diff --git a/scripts/context/ruby/base/tex.rb b/scripts/context/ruby/base/tex.rb
index 0969c3807..5898d7aa5 100644
--- a/scripts/context/ruby/base/tex.rb
+++ b/scripts/context/ruby/base/tex.rb
@@ -671,6 +671,7 @@ class TEX
else
report("unable to make format due to lack of permissions")
texformatpath = ''
+ setvariable('error','no permissions to write')
end
else
texformatpath = ''
@@ -821,7 +822,7 @@ class TEX
mainlanguage = getvariable('mainlanguage')
bodyfont = getvariable('bodyfont')
if f = openedfile("cont-fmt.tex") then
- f << "\\unprotect"
+ f << "\\unprotect\n"
case language
when 'all' then
f << "\\preloadallpatterns\n"
@@ -1103,8 +1104,10 @@ class TEX
end
rescue TimeoutError
report("job aborted due to timeout '#{delay}'")
+ setvariable('error','timeout')
rescue
report("job aborted due to error")
+ setvariable('error','fatal error')
else
report("job finished within timeout '#{delay}'")
end
diff --git a/scripts/context/ruby/base/tool.rb b/scripts/context/ruby/base/tool.rb
index 77ad947fe..5ccedfec1 100644
--- a/scripts/context/ruby/base/tool.rb
+++ b/scripts/context/ruby/base/tool.rb
@@ -129,6 +129,8 @@ module Tool
def Tool.simplefilename(old)
+ return old # too fragile
+
return old if not FileTest.file?(old)
new = old.downcase
@@ -258,7 +260,7 @@ module Tool
new = checksuffix(simplefilename(old))
unless new == old
- begin
+ begin # bugged, should only be name, not path
File.rename(old,new)
logging.report("renaming fuzzy name #{old} to #{new}") unless logging
return old
diff --git a/scripts/context/ruby/concheck.rb b/scripts/context/ruby/concheck.rb
index 6c7512bff..3db3e5148 100644
--- a/scripts/context/ruby/concheck.rb
+++ b/scripts/context/ruby/concheck.rb
@@ -308,7 +308,7 @@ def some_wrd_error(data, filename, start, stop, ignore)
end
end
-def some_sym_error (data, filename, symbol,template=false)
+def some_sym_error (data, filename, symbol, template=false)
saved = Array.new
inside = false
level = 0
diff --git a/scripts/context/ruby/ctxtools.rb b/scripts/context/ruby/ctxtools.rb
index 1e1158d44..d8d38e84b 100644
--- a/scripts/context/ruby/ctxtools.rb
+++ b/scripts/context/ruby/ctxtools.rb
@@ -1643,7 +1643,11 @@ class Commands
texmfroot = @commandline.argument('first')
texmfroot = '.' if texmfroot.empty?
- maproot = "#{texmfroot.gsub(/\\/,'/')}/fonts/map/pdftex/context"
+ if @commandline.option('maproot') then
+ maproot = @commandline.option('maproot')
+ else
+ maproot = "#{texmfroot.gsub(/\\/,'/')}/fonts/map/pdftex/context"
+ end
if File.directory?(maproot) then
files = Dir.glob("#{maproot}/*.map")
@@ -1737,7 +1741,7 @@ class Array
def add_shebang(filename,program)
unless self[0] =~ /^\#/ then
- self.insert(0,"\#!/usr/env #{program}")
+ self.insert(0,"\#!/usr/bin/env #{program}")
end
unless self[2] =~ /^\#.*?copyright\=/ then
self.insert(1,"\#")
@@ -2698,6 +2702,7 @@ commandline.registeraction('disarmutfbom' , 'remove utf bom [--force]')
commandline.registervalue('type','')
commandline.registervalue('filter','')
+commandline.registervalue('maproot','')
commandline.registerflag('recurse')
commandline.registerflag('force')
diff --git a/scripts/context/ruby/graphics/gs.rb b/scripts/context/ruby/graphics/gs.rb
index 070fd1be8..51175efa3 100644
--- a/scripts/context/ruby/graphics/gs.rb
+++ b/scripts/context/ruby/graphics/gs.rb
@@ -570,7 +570,12 @@ end
if ! epsbbox && str =~ /^%%(Page:|EndProlog)/io then
out.puts(str) if $1 == "EndProlog"
debug('faking papersize')
- out.puts("<< /PageSize [#{@width} #{@height}] >> setpagedevice\n")
+ # out.puts("<< /PageSize [#{@width} #{@height}] >> setpagedevice\n")
+ if ! dimensions? then
+ out.puts("<< /PageSize [1 1] >> setpagedevice\n")
+ else
+ out.puts("<< /PageSize [#{@width} #{@height}] >> setpagedevice\n")
+ end
out.puts("gsave #{@xoffset} #{@yoffset} translate\n")
epsbbox = true
elsif str =~ /^%%BeginBinary\:\s*\d+\s*$/o then
diff --git a/scripts/context/ruby/pstopdf.rb b/scripts/context/ruby/pstopdf.rb
index 3625f4d83..73e628df2 100644
--- a/scripts/context/ruby/pstopdf.rb
+++ b/scripts/context/ruby/pstopdf.rb
@@ -76,7 +76,7 @@ class Commands
@commandline.arguments.each do |filename|
- filename = Tool.cleanfilename(filename,@commandline)
+ filename = Tool.cleanfilename(filename,@commandline) # brrrr
inppath = @commandline.option('inputpath')
if inppath.empty? then
inppath = '.'
diff --git a/scripts/context/ruby/wwwserver.rb b/scripts/context/ruby/wwwserver.rb
index 53e1cdc51..13d5d1312 100644
--- a/scripts/context/ruby/wwwserver.rb
+++ b/scripts/context/ruby/wwwserver.rb
@@ -1,4 +1,4 @@
-#!/usr/env ruby
+#!/usr/bin/env ruby
banner = ['WWWServer', 'version 1.0.0', '2003-2006', 'PRAGMA ADE/POD']
diff --git a/scripts/context/ruby/xmltools.rb b/scripts/context/ruby/xmltools.rb
index 5b4a112b8..0c828e9d3 100644
--- a/scripts/context/ruby/xmltools.rb
+++ b/scripts/context/ruby/xmltools.rb
@@ -476,23 +476,23 @@ class Commands
"<#{elements.length}>"
end
# abc[-/]def
- data.gsub!(/([a-z]{3,})([\/\-])([a-z]{3,})/mois) do
+ data.gsub!(/([a-z]{3,})([\/\-\(\)])([a-z]{3,})/mois) do
done = true
report("compound: #{$1}#{$2}#{$3}") if verbose
"#{$1}<compound token='#{$2}'/>#{$3}"
end
# (abcd
- data.gsub!(/(\()([a-z]{4,})/mois) do
- done = true
- report("compound: #{$1}#{$2}") if verbose
- "<compound token='#{$1}'/>#{$2}"
- end
+ # data.gsub!(/(\()([a-z]{4,})/mois) do
+ # done = true
+ # report("compound: #{$1}#{$2}") if verbose
+ # "<compound token='#{$1}'/>#{$2}"
+ # end
# abcd)
- data.gsub!(/(\()([a-z]{4,})/mois) do
- done = true
- report("compound: #{$1}#{$2}") if verbose
- "#{$2}<compound token='#{$2}'/>"
- end
+ # data.gsub!(/(\()([a-z]{4,})/mois) do
+ # done = true
+ # report("compound: #{$1}#{$2}") if verbose
+ # "#{$2}<compound token='#{$2}'/>"
+ # end
# roll back elements
data.gsub!(/<(\d+)>/mois) do
"<#{elements.shift}>"