From f50135a32e11c535e1dc3a8e9460c5b4e640ee86 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 30 Jun 2022 13:16:46 +0200 Subject: feat: stdpath('run'), /tmp/nvim.user/ #18993 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Problem: - Since c57f6b28d71d #8519, sockets are created in ~/.local/… but XDG spec says: "XDG_RUNTIME_DIR: Must be on the local filesystem", which implies that XDG_STATE_DIR is potentially non-local. - Not easy to inspect Nvim-created temp files (for debugging etc). Solution: - Store sockets in stdpath('run') ($XDG_RUNTIME_DIR). - Establish "/tmp/nvim.user/" as the tempdir root shared by all Nvims. - Make ok() actually useful. - Introduce assert_nolog(). closes #3517 closes #17093 --- runtime/doc/builtin.txt | 4 +++- runtime/doc/starting.txt | 10 ++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/builtin.txt b/runtime/doc/builtin.txt index a8f75066e8..b458679560 100644 --- a/runtime/doc/builtin.txt +++ b/runtime/doc/builtin.txt @@ -7543,8 +7543,10 @@ stdpath({what}) *stdpath()* *E6100* is stored here. data_dirs List Other data directories. log String Logs directory (for use by plugins too). + run String Run directory: temporary, local storage + for sockets, named pipes, etc. state String Session state directory: storage for file - drafts, undo, shada, named pipes, ... + drafts, undo, shada, etc. Example: > :echo stdpath("config") diff --git a/runtime/doc/starting.txt b/runtime/doc/starting.txt index 4a88939715..108a47c522 100644 --- a/runtime/doc/starting.txt +++ b/runtime/doc/starting.txt @@ -1328,8 +1328,9 @@ paths. *base-directories* *xdg* The "base" (root) directories conform to the XDG Base Directory Specification. https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html -The $XDG_CONFIG_HOME, $XDG_DATA_HOME and $XDG_STATE_HOME environment variables -are used if they exist, otherwise default values (listed below) are used. +The $XDG_CONFIG_HOME, $XDG_DATA_HOME, $XDG_RUNTIME_DIR, and $XDG_STATE_HOME +environment variables are used if defined, else default values (listed below) +are used. CONFIG DIRECTORY (DEFAULT) ~ *$XDG_CONFIG_HOME* Nvim: stdpath("config") @@ -1341,6 +1342,11 @@ DATA DIRECTORY (DEFAULT) ~ Unix: ~/.local/share ~/.local/share/nvim Windows: ~/AppData/Local ~/AppData/Local/nvim-data +RUN DIRECTORY (DEFAULT) ~ + *$XDG_RUNTIME_DIR* Nvim: stdpath("run") + Unix: /tmp/nvim.user/xxx /tmp/nvim.user/xxx + Windows: $TMP/nvim.user/xxx $TMP/nvim.user/xxx + STATE DIRECTORY (DEFAULT) ~ *$XDG_STATE_HOME* Nvim: stdpath("state") Unix: ~/.local/state ~/.local/state/nvim -- cgit