Menu

Git Repository Merge Request #36: improve `show plot` behavior when there is no previous plot (open)

Merging...

Merged

Something went wrong. Please, merge manually

Checking if merge is possible...

Something went wrong. Please, merge manually

PuQ wants to merge 1 commit from /u/puq/gnuplot/ to master, 2025-11-02

Version: 6.0.3/6.1([e28e18])

When no last plot exists, show plot command will output an empty string as the last plot command, and the add2history option will add an empty line to the history file.

This patch adds a check to handle the empty last plot command. It provides a clearer message, and prevents the empty line from being added to the history file.

Before this patch:

gnuplot> show plot

        last plot command was:

gnuplot> show plot add

        last plot command was:

gnuplot> history
    1   show plot
    2   show plot add
    3

After:

gnuplot> show plot

        no previous plot

gnuplot> show plot add

        no previous plot

gnuplot> history
    1   show plot
    2   show plot add
Commit Date  
[161770] (improve-show-plot) by PuQ PuQ

improve `show plot` behavior when there is no previous plot

when no last plot exists, `show plot` command will output an empty
string as the last plot command, and the `add2history` option will
add an empty line to the history file.

Before this patch:
gnuplot> show plot
last plot command was:
gnuplot> show plot add
last plot command was:
gnuplot> history
1 show plot
2 show plot add
3

After:
gnuplot> show plot
no previous plot
gnuplot> show plot add
no previous plot
gnuplot> history
1 show plot
2 show plot add

2025-11-02 11:38:48 Tree

Discussion


Log in to post a comment.