Skip to content

Configuration files for luaotfload #201

@zauguin

Description

@zauguin

Looking into #200 I looked over the configuration file loading if luaotfload which reminded me that it is kind of a mess: Currently the first of the following files is loaded:

  • ./luaotfload.conf
  • ./luaotfloadrc
  • $XDG_CONFIG_HOME/luaotfload.conf
  • $XDG_CONFIG_HOME/luaotfloadrc
  • $HOME/.luaotfloadrc
  • Kpathsea lookup for luaotfloadrc
  • Kpathsea lookup for luaotfload.conf

There are quite some issues I have with this:

  1. Why is sometimes luaotfload.conf preferred and sometimes luaotfloadrc?
  2. Why do we need two names in the first place? Especially for the potentially costly kpathsea lookup this seems like a waste.
  3. Why should the user configuration file (e.g. in $XDG_CONFIG_HOME/luaotfload.conf be skipped if ./luaotfload.conf is present?

One suggestion to improve this would be:

  • Only use luaotfload.conf, but additionally look for luaotfloadrc for now and throw an error if it exists to avoid silently breaking something.
  • Load all found files in reverse order of preference. (So that local files can overwrite settings from more global files, but settings which are not overwritten still get applied.)
  • Remove the config.actions interfaces in the process or at least move them into less generic names.

Of course, this is potentially breaking existing configurations, but I would assume that these aren't used that much in the first place and even if people use these files, they can just rename them.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions