From 348eb8074fe0d314ca08fa39f4584019621e3f92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Wed, 20 Apr 2016 21:31:56 +0200 Subject: vis-lua: load files from directory specified with ./configure --sharedir=DIR Close #231 --- vis-lua.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'vis-lua.c') diff --git a/vis-lua.c b/vis-lua.c index fb560ab..6a47a7c 100644 --- a/vis-lua.c +++ b/vis-lua.c @@ -11,6 +11,10 @@ #include "vis-core.h" #include "text-motions.h" +#ifndef VIS_PATH +#define VIS_PATH "/usr/local/share/vis" +#endif + #if !CONFIG_LUA void vis_lua_init(Vis *vis) { } @@ -985,14 +989,12 @@ void vis_lua_init(Vis *vis) { * - $VIS_PATH/{,lexers} * - {,lexers} relative to the binary location * - $XDG_CONFIG_HOME/vis/{,lexers} (defaulting to $HOME/.config/vis/{,lexers}) - * - /usr/local/share/vis/{,lexers} - * - /usr/share/vis/{,lexers} + * - /usr/local/share/vis/{,lexers} (or whatever is specified during ./configure) * - package.path (standard lua search path) */ char path[PATH_MAX]; - vis_lua_path_add(vis, "/usr/share/vis"); - vis_lua_path_add(vis, "/usr/local/share/vis"); + vis_lua_path_add(vis, VIS_PATH); /* try to get users home directory */ const char *home = getenv("HOME"); -- cgit v1.2.3