From 26499816a973b3aab9aaf8e13b909d0bde4e2dd5 Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Mon, 7 Jun 2021 11:00:09 +0100 Subject: etc: Add "bordeaux.guix.gnu.org.pub" public key file. * etc/substitutes/bordeaux.guix.gnu.org.pub: New file. * Makefile.am (dist_pkgdata_DATA): Add it. * guix/self.scm (miscellaneous-files): Add "share/guix/bordeaux.guix.gnu.org.pub". --- etc/substitutes/bordeaux.guix.gnu.org.pub | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 etc/substitutes/bordeaux.guix.gnu.org.pub (limited to 'etc') diff --git a/etc/substitutes/bordeaux.guix.gnu.org.pub b/etc/substitutes/bordeaux.guix.gnu.org.pub new file mode 100644 index 0000000000..67085c4498 --- /dev/null +++ b/etc/substitutes/bordeaux.guix.gnu.org.pub @@ -0,0 +1,6 @@ +(public-key + (ecc + (curve Ed25519) + (q #7D602902D3A2DBB83F8A0FB98602A754C5493B0B778C8D1DD4E0F41DE14DE34F#) + ) + ) -- cgit v1.2.3 From f9d8206e5b1d8fe0a35a6e54e438a03c70ebabab Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 7 Jun 2021 14:07:02 +0200 Subject: news: Fix typo. * etc/news.scm: Remove 'x' introduced by mistake in dfdcd9d812d20a86babc4da8a01bc17e44900c3c. --- etc/news.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'etc') diff --git a/etc/news.scm b/etc/news.scm index 25bc0d40a2..3207c12152 100644 --- a/etc/news.scm +++ b/etc/news.scm @@ -50,7 +50,7 @@ Führen Sie @command{info \"(guix.de) Aufruf von guix import\"} aus, um mehr Informationen zu bekommen.") (zh "新的 @command{guix import egg} 命令能让贡献者从一个CHICKEN egg生 成一个包装或包装样板。 -x + @example guix import egg sourcehut @end example -- cgit v1.2.3 From 0b17dc4aaea85bf0e35184909914f81761fedf56 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Wed, 2 Jun 2021 14:26:28 +0200 Subject: etc: indent-code.el: Remove any existing tabs. * etc/indent-code.el (main): Call UNTABIFY on the sexp or entire buffer. --- etc/indent-code.el | 3 +++ 1 file changed, 3 insertions(+) (limited to 'etc') diff --git a/etc/indent-code.el b/etc/indent-code.el index 84b15b356f..bdea8ee8bf 100755 --- a/etc/indent-code.el +++ b/etc/indent-code.el @@ -99,6 +99,8 @@ nil t) (let ((indent-tabs-mode nil)) (beginning-of-defun) + (mark-sexp) + (untabify (point) (mark)) (indent-sexp) (save-buffer) (message "Done!")) @@ -108,6 +110,7 @@ ;; Indent all of FILE-NAME. (find-file file-name) (let ((indent-tabs-mode nil)) + (untabify (point-min) (point-max)) (indent-region (point-min) (point-max)) (save-buffer) (message "Done!"))) -- cgit v1.2.3 From 80a17aae7991c6df061a98bb71734485f4ca17e2 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Mon, 14 Jun 2021 10:44:07 +0200 Subject: bash completion: Really support subcommands. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * etc/completion/bash/guix (_guix_is_option): New function. (_guix_is_command): Remove function to replace it with simple string comparison… (_guix_complete): …here. Complete the ‘innermost’ command at point. --- etc/completion/bash/guix | 97 ++++++++++++++++++++++++++++++------------------ 1 file changed, 61 insertions(+), 36 deletions(-) (limited to 'etc') diff --git a/etc/completion/bash/guix b/etc/completion/bash/guix index 26480e5863..2b0ec56c92 100644 --- a/etc/completion/bash/guix +++ b/etc/completion/bash/guix @@ -1,5 +1,6 @@ # GNU Guix --- Functional package management for GNU # Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès +# Copyright © 2021 Tobias Geerinck-Rice # # This file is part of GNU Guix. # @@ -80,19 +81,16 @@ _guix_complete_option () COMPREPLY=($(compgen -W "$options" -- "${COMP_WORDS[${#COMP_WORDS[*]} - 1]}")) } -_guix_is_command () +_guix_is_option () { - local word - local result="false" - for word in ${COMP_WORDS[*]} - do - if [ "$word" = "$1" ] - then - result=true - break - fi - done - $result + case "$1" in + -*) + true + ;; + *) + false + ;; + esac } _guix_is_removing () @@ -183,22 +181,43 @@ _guix_complete () local word_count=${#COMP_WORDS[*]} local word_at_point="${COMP_WORDS[$COMP_CWORD]}" - if [ "$COMP_CWORD" -gt 1 ] - then - case "$word_at_point" in - -*) - _guix_complete_option "$word_at_point" - return - ;; - esac - fi + # Find the innermost command at point, e.g. "build" in the case of + # "guix time-machine OPTIONS -- build" -- but "time-machine" if + # point is moved before "build". + local command_index=0 + local command + local word_index=0 + local word + local expect_command="true" + while [[ $((++word_index)) -le COMP_CWORD ]] + do + word="${COMP_WORDS[$word_index]}" + if $expect_command + then + command_index=$word_index + command="$word" + expect_command="false" + continue + fi + if [[ "$word" = "--" ]] + then + case "$command" in + environment) + break + ;; + time-machine) + expect_command="true" + ;; + esac + fi + done case $COMP_CWORD in - 1) + $command_index) _guix_complete_command ;; *) - if _guix_is_command "package" + if [[ "$command" = "package" ]] then if _guix_is_dash_L || _guix_is_dash_m || _guix_is_dash_p || _guix_is_dash_f then @@ -209,7 +228,7 @@ _guix_complete () else _guix_complete_available_package "$word_at_point" fi - elif _guix_is_command "install" + elif [[ "$command" = "install" ]] then if _guix_is_dash_L || _guix_is_dash_m || _guix_is_dash_p then @@ -217,7 +236,7 @@ _guix_complete () else _guix_complete_available_package "$word_at_point" fi - elif _guix_is_command "remove" + elif [[ "$command" = "remove" ]] then if _guix_is_dash_L || _guix_is_dash_m || _guix_is_dash_p then @@ -225,7 +244,7 @@ _guix_complete () else _guix_complete_installed_package "$word_at_point" fi - elif _guix_is_command "upgrade" + elif [[ "$command" = "upgrade" ]] then if _guix_is_dash_L || _guix_is_dash_m || _guix_is_dash_p then @@ -233,7 +252,7 @@ _guix_complete () else _guix_complete_installed_package "$word_at_point" fi - elif _guix_is_command "build" + elif [[ "$command" = "build" ]] then if _guix_is_dash_L || _guix_is_dash_m || _guix_is_dash_f then @@ -241,7 +260,7 @@ _guix_complete () else _guix_complete_available_package "$word_at_point" fi - elif _guix_is_command "environment" + elif [[ "$command" = "environment" ]] then if _guix_is_dash_L || _guix_is_dash_m || _guix_is_dash_p || _guix_is_dash_l then @@ -249,22 +268,22 @@ _guix_complete () else _guix_complete_available_package "$word_at_point" fi - elif _guix_is_command "download" + elif [[ "$command" = "download" ]] then _guix_complete_file - elif _guix_is_command "system" + elif [[ "$command" = "system" ]] then case $COMP_CWORD in 2) _guix_complete_subcommand;; *) _guix_complete_file;; # TODO: restrict to *.scm esac - elif _guix_is_command "pull" + elif [[ "$command" = "pull" ]] then if _guix_is_dash_C || _guix_is_dash_p then _guix_complete_file fi - elif _guix_is_command "time-machine" + elif [[ "$command" = "time-machine" ]] then if _guix_is_dash_C then @@ -272,20 +291,20 @@ _guix_complete () else _guix_complete_command fi - elif _guix_is_command "container" + elif [[ "$command" = "container" ]] then case $COMP_CWORD in 2) _guix_complete_subcommand;; 3) _guix_complete_pid "$word_at_point";; *) _guix_complete_file;; esac - elif _guix_is_command "import" + elif [[ "$command" = "import" ]] then _guix_complete_subcommand - elif _guix_is_command "hash" || _guix_is_command "gc" + elif [[ "$command" = "hash" || "$command" = "gc" ]] then _guix_complete_file - elif _guix_is_command "weather" + elif [[ "$command" = "weather" ]] then if _guix_is_dash_m then @@ -296,6 +315,12 @@ _guix_complete () fi ;; esac + + if [[ -z "$COMPREPLY" && COMP_CWORD -gt command_index ]] && + _guix_is_option "$word_at_point" + then + _guix_complete_option + fi } complete -F _guix_complete guix -- cgit v1.2.3 From dc3ba8c83602d69294e21d1b0c066f0d89890b56 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Mon, 14 Jun 2021 10:58:57 +0200 Subject: bash completion: Complete options for the right command. * etc/completion/bash/guix (_guix_complete_option): Receive two arguments and complete the second based on the first, instead of blindly completing the very last word based on the very first (sub)command. (_guix_complete): Adjust both calls. --- etc/completion/bash/guix | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'etc') diff --git a/etc/completion/bash/guix b/etc/completion/bash/guix index 2b0ec56c92..f7d1eeb220 100644 --- a/etc/completion/bash/guix +++ b/etc/completion/bash/guix @@ -69,16 +69,17 @@ _guix_complete_installed_package () _guix_complete_option () { - local subcommand - case "${COMP_WORDS[2]}" in - -*) subcommand="";; - [a-z]*) subcommand="${COMP_WORDS[2]}";; - esac - local options="$(${COMP_WORDS[0]} ${COMP_WORDS[1]} $subcommand --help 2> /dev/null \ + local command="${COMP_WORDS[$1]}" + local subcommand="${COMP_WORDS[$(($1 + 1))]}" + if _guix_is_option "$subcommand" + then + subcommand="" + fi + local options="$(${COMP_WORDS[0]} $command $subcommand --help 2> /dev/null \ | grep '^ \+-' \ | sed -e's/^.*--\([a-zA-Z0-9_-]\+\)\(=\?\).*/--\1\2/g')" compopt -o nospace - COMPREPLY=($(compgen -W "$options" -- "${COMP_WORDS[${#COMP_WORDS[*]} - 1]}")) + COMPREPLY=($(compgen -W "$options" -- "$2")) } _guix_is_option () @@ -289,7 +290,7 @@ _guix_complete () then _guix_complete_file else - _guix_complete_command + _guix_complete_option "$command_index" "$word_at_point" fi elif [[ "$command" = "container" ]] then @@ -319,7 +320,7 @@ _guix_complete () if [[ -z "$COMPREPLY" && COMP_CWORD -gt command_index ]] && _guix_is_option "$word_at_point" then - _guix_complete_option + _guix_complete_option "$command_index" "$word_at_point" fi } -- cgit v1.2.3 From fa0dc1229c0dc44a7358d183e54d9e02d1199e39 Mon Sep 17 00:00:00 2001 From: Tobias Geerinckx-Rice Date: Mon, 14 Jun 2021 10:59:39 +0200 Subject: bash_completion: Complete options for ‘guix environment’. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Note that there are still plenty of bugs that this series didn't fix, e.g.: $ guix time-machine -- system reconf * etc/completion/bash/guix (_guix_complete): Call _guix_complete_option if the word at point looks like an option. --- etc/completion/bash/guix | 3 +++ 1 file changed, 3 insertions(+) (limited to 'etc') diff --git a/etc/completion/bash/guix b/etc/completion/bash/guix index f7d1eeb220..a9386e7794 100644 --- a/etc/completion/bash/guix +++ b/etc/completion/bash/guix @@ -266,6 +266,9 @@ _guix_complete () if _guix_is_dash_L || _guix_is_dash_m || _guix_is_dash_p || _guix_is_dash_l then _guix_complete_file + elif _guix_is_option "$word_at_point" + then + _guix_complete_option "$command_index" "$word_at_point" else _guix_complete_available_package "$word_at_point" fi -- cgit v1.2.3