Lem currently stores persistent history under (lem-home)/history,
which normally resolves to:
$XDG_CONFIG_HOME/lem/history
This means mutable application state is stored alongside user
configuration.
Persistent history such as recent files, command history, project
history, and REPL history seems to fit better under XDG_STATE_HOME,
for example:
$XDG_STATE_HOME/lem/history/
with the usual fallback:
~/.local/state/lem/history/
This also matters for declarative configuration managers such as
GNU Guix Home or Nix/Home Manager, where $XDG_CONFIG_HOME/lem
may be managed as an immutable/read-only directory.
Would it make sense for Lem to support a separate state directory,
perhaps something like lem-state-home, while keeping the existing
LEM_HOME behavior for backwards compatibility?
For example:
$XDG_CONFIG_HOME/lem/init.lisp
$XDG_STATE_HOME/lem/history/files
$XDG_STATE_HOME/lem/history/projects
$XDG_STATE_HOME/lem/history/commands
$XDG_STATE_HOME/lem/history/lisp-repl
I also noticed that some other mutable data, such as logs, is currently
stored relative to lem-home, but I'm keeping this issue specifically
about persistent history.
Lem currently stores persistent history under
(lem-home)/history,which normally resolves to:
This means mutable application state is stored alongside user
configuration.
Persistent history such as recent files, command history, project
history, and REPL history seems to fit better under XDG_STATE_HOME,
for example:
with the usual fallback:
This also matters for declarative configuration managers such as
GNU Guix Home or Nix/Home Manager, where
$XDG_CONFIG_HOME/lemmay be managed as an immutable/read-only directory.
Would it make sense for Lem to support a separate state directory,
perhaps something like
lem-state-home, while keeping the existingLEM_HOMEbehavior for backwards compatibility?For example:
I also noticed that some other mutable data, such as logs, is currently
stored relative to
lem-home, but I'm keeping this issue specificallyabout persistent history.