newsettings

LuaFAR for Editor

newsettings


hobj = far2_history.newsettings (Subkey, Name)

Parameters:
  Subkey: string; nil for the root key
  Name  : string

Returns:
  hobj  : history object (a table).

Description:
  - The function reads in the data from Far plugin settings
    database and executes this data as a Lua script, in an empty
    environment table.

  - The script is assumed to contain Lua data in the global
    variable Data (a table).

  - The environment table is returned, with its fields Subkey
    and Name set to the value of the respective received arguments.

  - If the subkey or data were absent or failed to compile, then
    the field Data of the returned object is an empty table.

  - If Subkey argument contains dots, then hierarchical subkeys are
    created in the database. E.g. specifying "key1.key2.key3" will
    create or access subkey "key3" under subkey "key2" under subkey
    "key1" under root.

  - The returned history object hobj has four methods:
    hobj:field, hobj:setfield, hobj:serialize and hobj:save.