* Bash completions
@ 2015-03-03 22:13 Ludovic Courtès
2015-03-16 22:24 ` Ludovic Courtès
0 siblings, 1 reply; 2+ messages in thread
From: Ludovic Courtès @ 2015-03-03 22:13 UTC (permalink / raw)
To: guix-devel
[-- Attachment #1: Type: text/plain, Size: 322 bytes --]
Hello!
I’m considering applying this so that Bash completions would work
out-of-the-box. Apparently handling of completions is not fully
standardized; this approach is based on the suggestions of the
‘bash-completion’ package on one hand the the Bash manual on the other.
Thoughts?
Thanks,
Ludo’.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 1710 bytes --]
diff --git a/gnu/system.scm b/gnu/system.scm
index 5a3842f..45d1424 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -355,6 +355,8 @@ explicitly appear in OS."
e2fsprogs kbd
+ bash-completion
+
;; The packages below are also in %FINAL-INPUTS, so take them from
;; there to avoid duplication.
(map canonical-package
@@ -461,6 +463,23 @@ export GIT_SSL_CAINFO=\"$SSL_CERT_FILE\"
# Allow Aspell to find dictionaries installed in the user profile.
export ASPELL_CONF=\"dict-dir $HOME/.guix-profile/lib/aspell\"
"))
+
+ (bashrc (text-file "bashrc" "\
+# Bash-specific initialization.
+
+# The 'bash-completion' package.
+if [ -f /run/current-system/profile/etc/profile.d/bash_completion.sh ]
+then
+ source /run/current-system/profile/etc/profile.d/bash_completion.sh
+fi
+
+# Automatic completion loading from the user profile
+# (info \"(bash) Programmable Completion\").
+_completion_loader()
+ {
+ . \"$HOME/.guix-profile/etc/bash_completion.d/$1.sh\" >/dev/null 2>&1 && return 124
+ }
+complete -D -F _completion_loader -o bashdefault -o default\n"))
(skel (skeleton-directory skeletons)))
(file-union "etc"
`(("services" ,#~(string-append #$net-base "/etc/services"))
@@ -474,6 +493,7 @@ export ASPELL_CONF=\"dict-dir $HOME/.guix-profile/lib/aspell\"
("skel" ,#~#$skel)
("shells" ,#~#$shells)
("profile" ,#~#$profile)
+ ("bashrc" ,#~#$bashrc)
("hosts" ,#~#$hosts-file)
("localtime" ,#~(string-append #$tzdata "/share/zoneinfo/"
#$timezone))
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-03-16 22:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-03-03 22:13 Bash completions Ludovic Courtès
2015-03-16 22:24 ` Ludovic Courtès
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.