diff options
author | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2011-10-21 14:45:34 +0000 |
---|---|---|
committer | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2011-10-21 14:45:34 +0000 |
commit | d6a79abc84563ca694881e371e36bea940575713 (patch) | |
tree | 6faa1fc85d19716a465b182e0c16d9a2d3e64dfe /Master/texmf/scripts | |
parent | e2e9bf0ede12f5587add897d7882ffe4c0d99995 (diff) |
texdoc 0.82 (fixes viewer guessing code)
git-svn-id: svn://tug.org/texlive/trunk@24354 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf/scripts')
-rw-r--r-- | Master/texmf/scripts/texdoc/config.tlu | 10 | ||||
-rw-r--r-- | Master/texmf/scripts/texdoc/constants.tlu | 2 |
2 files changed, 9 insertions, 3 deletions
diff --git a/Master/texmf/scripts/texdoc/config.tlu b/Master/texmf/scripts/texdoc/config.tlu index 7681425e9bb..3fde04d69b7 100644 --- a/Master/texmf/scripts/texdoc/config.tlu +++ b/Master/texmf/scripts/texdoc/config.tlu @@ -329,13 +329,18 @@ function is_in_path(name) end end --- guess a viewer from a list: +-- guess a viewer from a list: +-- - xdg-open from freedesktop if available -- - try detecting desktop environments -- - or return the first element of "list" whose name is found in path -- - or nil -- caches results of desktop environment detection do local de_viewer function guess_viewer(cmds) + -- try the freedesktop method + if is_in_path('xdg-open') then + return '(xdg-open %s) &' + end -- try desktop environment if not de_viewer then de_viewer = desktop_environment_viewer() end if de_viewer then return de_viewer end @@ -357,7 +362,8 @@ function desktop_environment_viewer() return '(kfmclient exec %s) &' -- kde < 4 end if os.getenv('GNOME_DESKTOP_SESSION_ID') then -- gnome - return '(gnome-open %s) &' + if is_in_path('gvfs-open') then return '(gvfs-open %s) &' end + if is_in_path('gnome-open') then return '(gnome-open %s) &' end end if not is_in_path('xprop') then return end local xprop_fh = io.popen('xprop -root _DT_SAVE_MODE 2>/dev/null') diff --git a/Master/texmf/scripts/texdoc/constants.tlu b/Master/texmf/scripts/texdoc/constants.tlu index 0a24aded4bd..8ff2e96d686 100644 --- a/Master/texmf/scripts/texdoc/constants.tlu +++ b/Master/texmf/scripts/texdoc/constants.tlu @@ -14,7 +14,7 @@ setfenv(1, constants) -- progname and version fullname = kpse.find_file('texdoc/texdoclib', 'lua') progname = 'texdoc' -version = '0.81' +version = '0.82' -- make sure to update setup_config_from_cl() accordingly -- and set a default value in setup_config_from_defaults() if relevant |