diff options
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 |