diff options
author | pboutill <pboutill@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2011-12-18 22:50:10 +0000 |
---|---|---|
committer | pboutill <pboutill@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2011-12-18 22:50:10 +0000 |
commit | 5536b6d56226c4e53bbd6c5ae9a2c419c6f08874 (patch) | |
tree | cca6de8f1309481bafea295d9647c2a62795b9d3 /ide/minilib.ml | |
parent | a428f79ca9ddacb4650c4a6bda7aa231e11d92ae (diff) |
CoqIde files position is freedesktop compliant.
Beware, it means that files position is not relative to coqtop position
but is given by XDG_DATA_DIRS and XDG_CONFIG_DIRS.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@14822 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'ide/minilib.ml')
-rw-r--r-- | ide/minilib.ml | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/ide/minilib.ml b/ide/minilib.ml index 4896cbd4b..cec77f3b8 100644 --- a/ide/minilib.ml +++ b/ide/minilib.ml @@ -87,8 +87,18 @@ let xdg_config_dirs = List.map (fun dir -> Filename.concat dir "coq") (path_to_list (Sys.getenv "XDG_CONFIG_DIRS")) with Not_found -> "/etc/xdg/coq"::(match Coq_config.configdir with |None -> [] |Some d -> [d])) +let xdg_data_home = + try + Filename.concat (Sys.getenv "XDG_DATA_HOME") "coq" + with Not_found -> + Filename.concat home "/.local/share/coq" + +let xdg_data_dirs = + xdg_data_home :: (try + List.map (fun dir -> Filename.concat dir "coq") (path_to_list (Sys.getenv "XDG_DATA_DIRS")) + with Not_found -> + "/usr/local/share/coq"::"/usr/share/coq"::(match Coq_config.datadir with |None -> [] |Some d -> [d])) -let coqlib = ref "" let coqtop_path = ref "" (* On a Win32 application with no console, writing to stderr raise |