From 6f2e58744704bbe038f551bcdf99536100071845 Mon Sep 17 00:00:00 2001 From: Jan Wielemaker Date: Wed, 4 Dec 2024 18:23:36 +0100 Subject: [PATCH] ENHANCED: pack_info/1: use colours and indicate autoload status. --- library/prolog_pack.pl | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/library/prolog_pack.pl b/library/prolog_pack.pl index 2f727af9c2..7e1d65a8c7 100644 --- a/library/prolog_pack.pl +++ b/library/prolog_pack.pl @@ -201,12 +201,13 @@ multi_valued(T, LabelFmt, LT, MoreValues). -pvalue_column(29). +pvalue_column(31). print_property_value(Prop-Fmt, Values) :- !, pvalue_column(C), - atomic_list_concat(['~w:~t~*|', Fmt, '~n'], Format), - format(Format, [Prop,C|Values]). + ansi_format(comment, '% ~w:~t~*|', [Prop, C]), + ansi_format(code, Fmt, Values), + ansi_format([], '~n', []). pack_info(Name, Level, Info) :- '$pack':pack(Name, BaseDir), @@ -236,6 +237,7 @@ pack_level_info(_, conflicts(_), 'Conflicts with', -). pack_level_info(_, replaces(_), 'Replaces packages', -). pack_level_info(info, library(_), 'Provided libraries', -). +pack_level_info(info, autoload(_), 'Autoload', -). pack_default(Level, Infos, Def) :- pack_level_info(Level, ITerm, _Format, Def), @@ -260,7 +262,11 @@ expand_file_name(Pattern, Files), maplist(atom_concat(LibDir), Plain, Files), convlist(base_name, Plain, Libs), - member(Lib, Libs). + member(Lib, Libs), + Lib \== 'INDEX'. +pack_info_term(BaseDir, autoload(true)) :- + atom_concat(BaseDir, '/prolog/INDEX.pl', IndexFile), + exists_file(IndexFile). pack_info_term(BaseDir, automatic(Boolean)) :- once(pack_status_dir(BaseDir, automatic(Boolean))). pack_info_term(BaseDir, built(Arch, Prolog)) :-