Module conf

Configuration.

Gives information about how MC is configured.

Functions

path(name) Returns the full path of some “configuration file”.

Tables

dirs Directories.
features Features.
features.api Lua API features.


Functions

path(name)

Returns the full path of some “configuration file”.

This is an interface to C’s mc_config_get_full_path(). It is a temporary(?) solution to the problem of finding pathnames in MC’s zoo.

Example:

-- Opens the "Directory hotlist" textual database in the editor.
keymap.bind('M-pgdn', function()
  mc.edit(conf.path 'hotlist')
end)

Parameters:

Tables

dirs
Directories.

This table contains paths of directories where MC-related configuration and data are stored.

Fields:

  • user_config Location of user configuration.
  • user_data Location of user data.
  • user_cache Location of user cache.
  • user_lua Location of user Lua scripts.
  • system_config Location of system configuration.
  • system_data Location of system data.
  • system_lua Location of system Lua scripts.
features
Features.

This table contains booleans that tell whether some MC feature was compiled in, or not.

Fields:

  • luafs Has LuaFS (writing virtual filesystems in Lua).
  • editbox Has internal editor.
  • diff Has diff viewer.
  • charset Has charset support.
features.api
Lua API features.

This table is similar to the features table except that it deals with Lua API features. This is actually a versioning mechanism: if MC’s developers introduce some feature, during the lifetime of one major version, they can declare it in this table and your module can check for it thus:

assert(conf.features.api.a_fabulous_feature_i_need, E"I need this fabulous feature you don't have!")

It is expected that this mechanism be used by internal MC code only. User code can rely on the version number embedded in Lua directories. All features declared in this table should be removed once the version number increments.

generated by LDoc 1.4.3 Last updated 2016-08-23 17:29:40