|
From: Jun T <tak...@kb...> - 2021-09-14 09:12:08
|
> 2021/09/14 4:06, Ethan A Merritt <me...@uw...> wrote:
>
> I realize that the previous XDG patch already put a
> chunk of code in plot.c to hande the gnuplotrc file, but wouldn't it
> be better to have that code and the new patch code for the history file
> live in xdg.c instead?
> Then in plot.c or history.c the call site would
> be:
>
> #ifdef USE_XDG_BASEDIR
> expanded_history_filename = some_new_xdg_routine(GNUPLOT_HISTORY_FILE));
> #endif
> if (!expanded_history_filename) {
> /* current code */
> expanded_history_filename = tilde_expand(GNUPLOT_HISTORY_FILE);
> }
> read_history(expanded_history_filename);
How about the revised patch (xdg-v2.patch)?
I moved "most" of the complication into a function in xdg.c, but plot.c is
not as simple as above.
>> [2] Migration
>> With the patch, gnuplot will continue to use traditional config or history
>> files in ~/ if they exist (as it does for the main config file ~/.gnuplot).
>> Users must move the traditional files to XDG dirs (or remove ~/.gnuplot-wxt
>> and ~/.gnuplot_history) manually if they want to migrate.
>
> Isn't the obvious migration to set
> XDG_DATA_DIRS = $HOME:$HOME/.local/share
> XDG_CONFIG_HOME = $HOME:$HOME/.config
I couldn't understand this part...
> Your current home directory files will be used whether or not
> you have XDG enabled, so moving files is not required.
> If you choose to enable XDG and move the files, that works also.
Yes, this is the case with my match.
As I wrote, with my patch, if ~/.gnuplot_history or ~/.gnuplot-wxt exists
gnuplot will continue to use them. User need not do anything if they are
satisfied with this traditional behavior.
If a user wants to use XDG directory, she/he must manually move
~/.gnuplot_history to ~/.local/state/gnuplot_history, and
~/.gnuplot-wxt to ~/.config/gnuplot/gnuplot-wxt.conf
(or just remove them), but need not set XDG_CONFIG_HOME etc.
(if XDG_CONFIG_HOME is set then it is used instead of ~/.config/, of course)
Is this OK?
|