From 9d66ddc8408b98362d5377cc498af02ff60eb991 Mon Sep 17 00:00:00 2001 From: Karolina Gontarek Date: Fri, 16 Apr 2021 20:23:14 +0200 Subject: [PATCH] Rename variable to fish_killring --- CHANGELOG.rst | 2 +- doc_src/interactive.rst | 2 +- doc_src/language.rst | 2 +- src/env.cpp | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index ac9277455..db05a2634 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -38,7 +38,7 @@ Interactive improvements - ``funced`` won't include an entry on where a function is defined, thanks to the new ``functions --no-details`` option (:issue:`7879`). - The git prompt now has the same symbol order in normal and "informative" mode, and it's customizable via ``$__fish_git_prompt_status_order`` (:issue:`7926`). - The git prompt now shows staged state in non-informative mode even when not told to show "dirty" files. -- Variable ``killring`` containing entries from killring is now available (:issue:`7445`). +- Variable ``fish_killring`` containing entries from killring is now available (:issue:`7445`). New or improved bindings ^^^^^^^^^^^^^^^^^^^^^^^^ diff --git a/doc_src/interactive.rst b/doc_src/interactive.rst index 0ad901cc1..c36162620 100644 --- a/doc_src/interactive.rst +++ b/doc_src/interactive.rst @@ -397,7 +397,7 @@ Fish uses an Emacs-style kill ring for copy and paste functionality. For example Copy and paste from outside are also supported, both via the :kbd:`Control`\ +\ :kbd:`X` / :kbd:`Control`\ +\ :kbd:`V` bindings (the ``fish_clipboard_copy`` and ``fish_clipboard_paste`` functions [#]_) and via the terminal's paste function, for which fish enables "Bracketed Paste Mode", so it can tell a paste from manually entered text. In addition, when pasting inside single quotes, pasted single quotes and backslashes are automatically escaped so that the result can be used as a single token simply by closing the quote after. -Kill ring entries are stored in ``killring`` variable. +Kill ring entries are stored in ``fish_killring`` variable. .. [#] These rely on external tools. Currently xsel, xclip, wl-copy/wl-paste and pbcopy/pbpaste are supported. diff --git a/doc_src/language.rst b/doc_src/language.rst index 5a8d6d4bd..15b3984f7 100644 --- a/doc_src/language.rst +++ b/doc_src/language.rst @@ -1262,7 +1262,7 @@ Fish also provides additional information through the values of certain environm - ``version``, the version of the currently running fish (also available as ``FISH_VERSION`` for backward compatibility). -- ``killring``, list of entries in fish kill ring. +- ``fish_killring``, list of entries in fish kill ring. As a convention, an uppercase name is usually used for exported variables, while lowercase variables are not exported. (``CMD_DURATION`` is an exception for historical reasons). This rule is not enforced by fish, but it is good coding practice to use casing to distinguish between exported and unexported variables. diff --git a/src/env.cpp b/src/env.cpp index 32fbd529c..c9a087a17 100644 --- a/src/env.cpp +++ b/src/env.cpp @@ -91,10 +91,10 @@ static constexpr const electric_var_t electric_variables[] = { {L"SHLVL", electric_var_t::freadonly | electric_var_t::fexports}, {L"_", electric_var_t::freadonly}, {L"fish_kill_signal", electric_var_t::freadonly | electric_var_t::fcomputed}, + {L"fish_killring", electric_var_t::freadonly | electric_var_t::fcomputed}, {L"fish_pid", electric_var_t::freadonly}, {L"history", electric_var_t::freadonly | electric_var_t::fcomputed}, {L"hostname", electric_var_t::freadonly}, - {L"killring", electric_var_t::freadonly | electric_var_t::fcomputed}, {L"pipestatus", electric_var_t::freadonly | electric_var_t::fcomputed}, {L"status", electric_var_t::freadonly | electric_var_t::fcomputed}, {L"status_generation", electric_var_t::freadonly | electric_var_t::fcomputed}, @@ -718,8 +718,8 @@ maybe_t env_scoped_impl_t::try_get_computed(const wcstring &key) cons wcstring_list_t result; if (history) history->get_history(result); return env_var_t(L"history", std::move(result)); - } else if (key == L"killring") { - return env_var_t(L"killring", kill_entries()); + } else if (key == L"fish_killring") { + return env_var_t(L"fish_killring", kill_entries()); } else if (key == L"pipestatus") { const auto &js = perproc_data().statuses; wcstring_list_t result;