diff options
author | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2011-05-18 20:21:44 +0000 |
---|---|---|
committer | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2011-05-18 20:21:44 +0000 |
commit | e71eaa026ac3384e0e25e3cae94a54be4fe69223 (patch) | |
tree | 44eaf7ef2af6da9e2d4f4599e391a29bf66f0c4e /Master/texmf/scripts/texdoc/alias.tlu | |
parent | 0d6f6d802fc805abf007cdde14f242de7450c587 (diff) |
texdoc 0.80
git-svn-id: svn://tug.org/texlive/trunk@22522 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf/scripts/texdoc/alias.tlu')
-rw-r--r-- | Master/texmf/scripts/texdoc/alias.tlu | 34 |
1 files changed, 28 insertions, 6 deletions
diff --git a/Master/texmf/scripts/texdoc/alias.tlu b/Master/texmf/scripts/texdoc/alias.tlu index f364fa90f76..a99a8b51058 100644 --- a/Master/texmf/scripts/texdoc/alias.tlu +++ b/Master/texmf/scripts/texdoc/alias.tlu @@ -13,14 +13,20 @@ load_env(L, { --[[ structure of the alias table -alias = { name1 = aliasentry1, ... } +alias = { + name1 = { <true or nill> stop, <aliasentry> aliasentry1, ... }, + ... +} +stop == true means further alias directives should be ignored aliasentry = { - name = <string> pattern to be matched, - score = <number or nil> associated score (may be nil), - original = <true or nil> is this the original keyword?, + name = <string> pattern to be matched, + score = <number or nil> associated score, + original = <true or nil> is this the original keyword?, + locale = <true or nil> is this entry found via config.lang? } score == nil means to use the default score (defined in score.tlu) + --]] -- alias is local to this file @@ -57,12 +63,28 @@ end -- get patterns for a name function get_patterns(name, no_alias) local n = string.lower(name) + -- get normal aliases + local res if config.mode ~= 'regex' and config.alias_switch and not no_alias and alias[n] then - return alias[n] + res = alias[n] else - return { make_alias(name, false) } + res = { make_alias(name, false) } + end + -- check for language-specific aliases + local lang = config.lang and alias[n .. '-' .. config.lang] + if lang then + for _, entry in ipairs(lang) do + if not entry.original then + table.insert(res, { + name = entry.name, + score = entry.score, + locale = true, + }) + end + end end + return res end -- interpret a confline as an alias setting or return false |