From d72899f2c0af7fa59939481539dfb080ac6a7a2e Mon Sep 17 00:00:00 2001 From: Markus Pfeiffer Date: Thu, 21 Jan 2016 09:25:36 +0000 Subject: [PATCH] Make SetUserPreferences obsolete It should be removed in 4.9 --- lib/init.g | 47 ----------------------------------------------- lib/obsolete.gi | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 47 deletions(-) diff --git a/lib/init.g b/lib/init.g index de1a7a298b5..71005ca818d 100644 --- a/lib/init.g +++ b/lib/init.g @@ -756,51 +756,6 @@ TypeObj(IMPLICATIONS[1]); #T and what about implications installed in packages? #T (put later installations to the front?) - -############################################################################# -## -## Set the defaults of `GAPInfo.UserPreferences'. -## -## We locate the first file `gap.ini' in GAP root directories, -## and read it if available. -## This must be done before `GAPInfo.UserPreferences' is used. -## Some of the preferences require an initialization, -## but this cannot be called before the complete library has been loaded. -## - -# The following function is not recommended anymore. -# Give a warning but do what the function was expected to do. -BindGlobal( "SetUserPreferences", function( arg ) - local name, record; - - Info( InfoWarning, 1, ""); - Info( InfoWarning, 1, Concatenation( [ - "The call to 'SetUserPreferences' (probably in a 'gap.ini' file)\n", - "#I should be replaced by individual 'SetUserPreference' calls,\n", - "#I which are package specific.\n", - "#I Try 'WriteGapIniFile()'." ] ) ); - - # Set the new values. - if Length( arg ) = 1 then - record:= arg[1]; - if not IsBound(GAPInfo.UserPreferences.gapdoc) then - GAPInfo.UserPreferences.gapdoc := rec(); - fi; - if not IsBound(GAPInfo.UserPreferences.gap) then - GAPInfo.UserPreferences.gap := rec(); - fi; - for name in RecNames( record ) do - if name in [ "HTMLStyle", "TextTheme", "UseMathJax" ] then - GAPInfo.UserPreferences.gapdoc.( name ):= record.( name ); - else - GAPInfo.UserPreferences.gap.( name ):= record.( name ); - fi; - od; - fi; - end ); - -# SetUserPreferences(); - # Here are a few general user preferences which may be useful for # various purposes. They are self-explaining. DeclareUserPreference( rec( @@ -827,7 +782,6 @@ CallAndInstallPostRestore( function() READ_GAP_ROOT( "gap.ini" ); end ); - ############################################################################# ## #X files installing compatibility with deprecated, obsolescent or @@ -857,7 +811,6 @@ CallAndInstallPostRestore( function() fi; end ); - ############################################################################# ## ## ParGAP/MPI slave hook diff --git a/lib/obsolete.gi b/lib/obsolete.gi index 1b497fde5cb..906f3b8dcbf 100644 --- a/lib/obsolete.gi +++ b/lib/obsolete.gi @@ -889,6 +889,47 @@ InstallGlobalFunction( USER_HOME_EXPAND, function(str) return UserHomeExpand(str); end); +############################################################################# +## +#F SetUserPreferences +## +## Set the defaults of `GAPInfo.UserPreferences'. +## +## We locate the first file `gap.ini' in GAP root directories, +## and read it if available. +## This must be done before `GAPInfo.UserPreferences' is used. +## Some of the preferences require an initialization, +## but this cannot be called before the complete library has been loaded. +## +BindGlobal( "SetUserPreferences", function( arg ) + local name, record; + + Info( InfoWarning, 1, ""); + Info( InfoWarning, 1, Concatenation( [ + "The call to 'SetUserPreferences' (probably in a 'gap.ini' file)\n", + "#I should be replaced by individual 'SetUserPreference' calls,\n", + "#I which are package specific.\n", + "#I Try 'WriteGapIniFile()'." ] ) ); + + # Set the new values. + if Length( arg ) = 1 then + record:= arg[1]; + if not IsBound(GAPInfo.UserPreferences.gapdoc) then + GAPInfo.UserPreferences.gapdoc := rec(); + fi; + if not IsBound(GAPInfo.UserPreferences.gap) then + GAPInfo.UserPreferences.gap := rec(); + fi; + for name in RecNames( record ) do + if name in [ "HTMLStyle", "TextTheme", "UseMathJax" ] then + GAPInfo.UserPreferences.gapdoc.( name ):= record.( name ); + else + GAPInfo.UserPreferences.gap.( name ):= record.( name ); + fi; + od; + fi; + end ); + ############################################################################# ## #E