New config file structure

I’ve pushed a series of commits to deal with Location of personal init file (XDG_CONFIG_HOME). The commit message on the main repo is

    MODIFIED: Place the personal init file in a common place on all
    operating systems.  This directory is located in one of the directories
    below and names `swi-prolog`
    
      - Windows: CSIDL directory APPDATA (see win_folder/2)
      - Otherwise
        - $XDG_CONFIG_HOME
        - $HOME/.config
    
    In this directory we find:
    
      - init.pl (previously .swiplrc or swipl.ini (Windows)
        Personal initialization file
      - lib (previously ~/lib/prolog)
        Personal library
     -  pack (previously ~/lib/swipl/pack)
        Installed add-ons.
      - xpce (previously ~/.xpce)
        Directory holding xpce application data
    
    If you use multiple versions we suggest to create the new hierarchy and
    make symbolic links from the old locations.  Windows users will have to
    live with copies.

If you update by pulling git and running make/ninja instead of using a clean build you get a crash from xpce. This can be solved by first running this to delete the quick load files. At some point this should be fixed in the CMake files :frowning:

find . -name '*.qlf' | xargs rm

I don’t think the conversion is too painful. If you disagree and see (simple) ways to improve, please share.

1 Like

An idea to help new users transitioning, is to print a message like this when swipl starts:

The ~/.swiplrc file should now be in ~/.config/swi-prolog/init.pl, do
 you want me to move it there (m),  copyt it (c),  make a symbolic
 link (l), or to simply leave it alone (a) ? Please answer m/l/c/a: 

Note that NTFS supports symbolic links also.

This messgae would be printed only once, if ~/.config/swi-prolog/init.pl is not found, but ~/.swiplrc is found.

That makes sense as a temporary work around. I think I’ll opt for merely a warning though.

Wasn’t that only between directories? At least, that is in my memory.

I think only for files, not directories.