summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/context/ruby/base/texutil.rb12
-rw-r--r--scripts/context/ruby/ctxtools.rb12
-rw-r--r--scripts/context/ruby/texmfstart.rb9
3 files changed, 23 insertions, 10 deletions
diff --git a/scripts/context/ruby/base/texutil.rb b/scripts/context/ruby/base/texutil.rb
index 4c9bf6139..e4c9ec60d 100644
--- a/scripts/context/ruby/base/texutil.rb
+++ b/scripts/context/ruby/base/texutil.rb
@@ -183,6 +183,11 @@ class TeXUtil
else
@rexb = /(\\[a-zA-Z]+|.)\s*/o
end
+ if true then
+ @exp.keys.each do |e|
+ @exp[e].downcase!
+ end
+ end
end
def remap(str)
@@ -211,7 +216,6 @@ class TeXUtil
end
def preset(shortcuts=[],expansions=[],reductions=[],divisions=[])
- # maybe we should move this to sort-def.tex
'a'.upto('z') do |c| expander(c) ; division(c) end
'A'.upto('Z') do |c| expander(c) ; division(c) end
expander('1','b') ; expander('2','c') ; expander('3','e') ; expander('4','f')
@@ -385,7 +389,7 @@ class TeXUtil
class Synonym
@@debug = false
- # @@debug = true
+ @@debug = true
def initialize(t, c, k, d)
@type, @command, @key, @sortkey, @data = t, c, k, k, d
@@ -464,7 +468,7 @@ class TeXUtil
class Register
@@debug = false
- # @@debug = true
+ @@debug = true
@@howto = /^(.*?)\:\:(.*)$/o
@@split = ' && '
@@ -567,7 +571,7 @@ class TeXUtil
# character = "\\getvalue\{#{alpha}\}"
character = "\\#{alpha}"
else
- character = "\\#{alpha}"
+ character = "\\unknown"
end
handle << "\\registerentry{#{entry.type}}{#{character}}\n"
end
diff --git a/scripts/context/ruby/ctxtools.rb b/scripts/context/ruby/ctxtools.rb
index 94e6e735a..41489a13d 100644
--- a/scripts/context/ruby/ctxtools.rb
+++ b/scripts/context/ruby/ctxtools.rb
@@ -1204,6 +1204,7 @@ class Commands
@@languagedata['hr' ] = [ 'ec' , ['hrhyph.tex'] ]
@@languagedata['hu' ] = [ 'ec' , ['huhyphn.tex'] ]
@@languagedata['en' ] = [ 'default' , [['ushyphmax.tex','ushyph.tex','hyphen.tex']] ]
+ @@languagedata['us' ] = [ 'default' , [['ushyphmax.tex','ushyph.tex','hyphen.tex']] ]
# inhyph.tex
@@languagedata['is' ] = [ 'ec' , ['ishyph.tex'] ]
@@languagedata['it' ] = [ 'ec' , ['ithyph.tex'] ]
@@ -1235,10 +1236,11 @@ class Commands
texmfroot = @commandline.argument('first')
texmfroot = '.' if texmfroot.empty?
- maproot = "#{texmfroot}/fonts/map/pdftex/context"
+ maproot = "#{texmfroot.gsub(/\\/,'/')}/fonts/map/pdftex/context"
if File.directory?(maproot) then
- if files = Dir.glob("#{maproot}/*.map") and files.size > 0 then
+ files = Dir.glob("#{maproot}/*.map")
+ if files.size > 0 then
files.each do |pdffile|
next if File.basename(pdffile) == 'pdftex.map'
pdffile = File.expand_path(pdffile)
@@ -1267,6 +1269,12 @@ class Commands
data.delete_if do |line|
line.gsub(/\s+/,'').empty?
end
+ data.collect! do |line|
+ # remove line with "name name" lines
+ line.gsub(/^(\S+)\s+\1\s*$/) do
+ $1
+ end
+ end
begin
if force then
if n > 0 then
diff --git a/scripts/context/ruby/texmfstart.rb b/scripts/context/ruby/texmfstart.rb
index 0dfd14263..5d0b286b0 100644
--- a/scripts/context/ruby/texmfstart.rb
+++ b/scripts/context/ruby/texmfstart.rb
@@ -90,7 +90,7 @@ end
$scriptlist = 'rb|pl|py|lua|jar'
$documentlist = 'pdf|ps|eps|htm|html'
-$editor = ENV['EDITOR'] || ENV['editor'] || 'scite'
+$editor = ENV['TEXMFSTART_EDITOR'] || ENV['EDITOR'] || ENV['editor'] || 'scite'
$crossover = true # to other tex tools, else only local
@@ -385,7 +385,7 @@ def usage
print("switches : --verbose --report --browser --direct --execute --locate --iftouched\n")
print(" --program --file --page --arguments --batch --edit --report --clear\n")
print(" --make --lmake --wmake --path --stubpath --indirect --before --after\n")
- print(" --tree\n")
+ print(" --tree --autotree\n")
print("\n")
print("example : texmfstart pstopdf.rb cow.eps\n")
print(" texmfstart --locate examplex.rb\n")
@@ -768,9 +768,10 @@ def execute(arguments)
$execute = $directives['execute'] || $directives['exec'] || false
$locate = $directives['locate'] || false
- $path = $directives['path'] || ''
- $tree = $directives['tree'] || ''
+ $autotree = if $directives['autotree'] then (ENV['TEXMFSTART_TREE'] || '') else '' end
+ $path = $directives['path'] || ''
+ $tree = $directives['tree'] || $autotree || ''
$make = $directives['make'] || false
$unix = $directives['unix'] || false