+
+string Theme::format_status_line(const string &disk_space_left_text, double file_length_seconds)
+{
+ lock_guard<mutex> lock(m);
+ lua_getglobal(L, "format_status_line");
+ if (lua_isnil(L, -1)) {
+ lua_pop(L, 1);
+ return disk_space_left_text;
+ }
+
+ lua_pushstring(L, disk_space_left_text.c_str());
+ lua_pushnumber(L, file_length_seconds);
+ if (lua_pcall(L, 2, 1, 0) != 0) {
+ fprintf(stderr, "error running function format_status_line(): %s\n", lua_tostring(L, -1));
+ abort();
+ }
+ string text = checkstdstring(L, 1);
+ lua_pop(L, 1);
+ assert(lua_gettop(L) == 0);
+ return text;
+}