Rename "snippets" to "conf" internally, and document them as snippets

Discussed in #2896.
This commit is contained in:
David Adam 2016-04-05 22:22:12 +08:00
parent 9e93ddc097
commit 200a10e78d
6 changed files with 15 additions and 15 deletions

View file

@ -55,7 +55,7 @@ docdir = @docdir@
localedir = @localedir@ localedir = @localedir@
extra_completionsdir = @extra_completionsdir@ extra_completionsdir = @extra_completionsdir@
extra_functionsdir = @extra_functionsdir@ extra_functionsdir = @extra_functionsdir@
extra_snippetsdir = @extra_snippetsdir@ extra_confdir = @extra_confdir@
# #
# pcre2 # pcre2
@ -472,7 +472,7 @@ doc.h: $(HDR_FILES)
-e "s,@docdir\@,$(docdir),g" \ -e "s,@docdir\@,$(docdir),g" \
-e "s,@extra_completionsdir\@,$(extra_completionsdir),g" \ -e "s,@extra_completionsdir\@,$(extra_completionsdir),g" \
-e "s,@extra_functionsdir\@,$(extra_functionsdir),g" \ -e "s,@extra_functionsdir\@,$(extra_functionsdir),g" \
-e "s,@extra_snippetsdir\@,$(extra_snippetsdir),g" \ -e "s,@extra_confdir\@,$(extra_confdir),g" \
-e "s|@configure_input\@|$@, generated from $@.in by the Makefile. DO NOT MANUALLY EDIT THIS FILE!|g" \ -e "s|@configure_input\@|$@, generated from $@.in by the Makefile. DO NOT MANUALLY EDIT THIS FILE!|g" \
-e "s,@prefix\@,$(prefix),g" \ -e "s,@prefix\@,$(prefix),g" \
-e "s,@fish_build_version\@,$(FISH_BUILD_VERSION),g" \ -e "s,@fish_build_version\@,$(FISH_BUILD_VERSION),g" \
@ -665,7 +665,7 @@ install-force: all install-translations
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/completions $(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/completions
$(INSTALL) -m 755 -d $(DESTDIR)$(extra_completionsdir) $(INSTALL) -m 755 -d $(DESTDIR)$(extra_completionsdir)
$(INSTALL) -m 755 -d $(DESTDIR)$(extra_functionsdir) $(INSTALL) -m 755 -d $(DESTDIR)$(extra_functionsdir)
$(INSTALL) -m 755 -d $(DESTDIR)$(extra_snippetsdir) $(INSTALL) -m 755 -d $(DESTDIR)$(extra_confdir)
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/functions $(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/functions
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/man/man1 $(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/man/man1
$(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/tools $(INSTALL) -m 755 -d $(DESTDIR)$(datadir)/fish/tools

View file

@ -877,12 +877,12 @@ AC_ARG_WITH([extra_functionsdir],
[extra_functionsdir=$withval], [extra_functionsdir=$withval],
[extra_functionsdir='${datadir}/fish/vendor_functions.d']) [extra_functionsdir='${datadir}/fish/vendor_functions.d'])
AC_SUBST(extra_snippetsdir) AC_SUBST(extra_confdir)
AC_ARG_WITH([extra-snippetsdir], AC_ARG_WITH([extra-confdir],
AS_HELP_STRING([--with-extra-snippetsdir=DIR], AS_HELP_STRING([--with-extra-confdir=DIR],
[path for extra snippets]), [path for extra conf]),
[extra_snippetsdir=$withval], [extra_confdir=$withval],
[extra_snippetsdir='${datadir}/fish/vendor_conf.d']) [extra_confdir='${datadir}/fish/vendor_conf.d'])
# Tell the world what we know. # Tell the world what we know.
AC_CONFIG_FILES([Makefile]) AC_CONFIG_FILES([Makefile])

View file

@ -1111,7 +1111,7 @@ On startup, Fish evaluates a number of configuration files, which can be used to
Configuration files are evaluated in the following order: Configuration files are evaluated in the following order:
- Configuration shipped with fish, which should not be edited, usually `/usr/share/fish/config.fish`. - Configuration shipped with fish, which should not be edited, usually `/usr/share/fish/config.fish`.
- System-wide configuration files, where administrators can include initialization that should be run for all users on the system - similar to `/etc/profile` for POSIX-style shells - usually `/etc/fish/config.fish`; - System-wide configuration files, where administrators can include initialization that should be run for all users on the system - similar to `/etc/profile` for POSIX-style shells - usually `/etc/fish/config.fish`;
- "Unit" configuration files ending in `.fish`, in the directories: - Configuration snippets in files ending in `.fish`, in the directories:
- `~/.config/fish/conf.d/` - `~/.config/fish/conf.d/`
- `/etc/fish/conf.d` - `/etc/fish/conf.d`
- `/usr/share/fish/vendor_conf.d` - `/usr/share/fish/vendor_conf.d`

View file

@ -2,7 +2,7 @@ prefix=@prefix@
datadir=@datadir@ datadir=@datadir@
completionsdir=@extra_completionsdir@ completionsdir=@extra_completionsdir@
functionsdir=@extra_functionsdir@ functionsdir=@extra_functionsdir@
confdir=@extra_snippetsdir@ confdir=@extra_confdir@
Name: fish Name: fish
Description: fish, the friendly interactive shell Description: fish, the friendly interactive shell

View file

@ -1,8 +1,8 @@
# @configure_input@ # @configure_input@
# This function is generated by the autotools build to "compile in" # This function is generated by the autotools build to "compile in"
# the local "vendor" completions, functions and configuration snippets. # the local "vendor" completions, functions and configuration conf.
# It is sourced by share/config.fish, if it exists. # It is sourced by share/config.fish, if it exists.
set __extra_completionsdir @extra_completionsdir@ set __extra_completionsdir @extra_completionsdir@
set __extra_functionsdir @extra_functionsdir@ set __extra_functionsdir @extra_functionsdir@
set __extra_snippetsdir @extra_snippetsdir@ set __extra_confdir @extra_confdir@

View file

@ -49,7 +49,7 @@ end
# third-party packages to ship completions &c. # third-party packages to ship completions &c.
set -l __extra_completionsdir set -l __extra_completionsdir
set -l __extra_functionsdir set -l __extra_functionsdir
set -l __extra_snippetsdir set -l __extra_confdir
if test -f $__fish_datadir/__fish_build_paths.fish if test -f $__fish_datadir/__fish_build_paths.fish
source $__fish_datadir/__fish_build_paths.fish source $__fish_datadir/__fish_build_paths.fish
end end
@ -166,7 +166,7 @@ end
# As last part of initialization, source the conf directories # As last part of initialization, source the conf directories
# Implement precedence (User > Admin > Extra (e.g. vendors) > Fish) by basically doing "basename" # Implement precedence (User > Admin > Extra (e.g. vendors) > Fish) by basically doing "basename"
set -l sourcelist set -l sourcelist
for file in $configdir/fish/conf.d/*.fish $__fish_sysconfdir/conf.d/*.fish $__extra_snippetsdir/*.fish for file in $configdir/fish/conf.d/*.fish $__fish_sysconfdir/conf.d/*.fish $__extra_confdir/*.fish
set -l basename (string replace -r '^.*/' '' -- $file) set -l basename (string replace -r '^.*/' '' -- $file)
contains -- $basename $sourcelist; and continue contains -- $basename $sourcelist; and continue
set sourcelist $sourcelist $basename set sourcelist $sourcelist $basename