Menu

Git Repository Merge Request #34: improve history file support (open)

Merging...

Merged

Something went wrong. Please, merge manually

Checking if merge is possible...

Something went wrong. Please, merge manually

PuQ wants to merge 7 commits from /u/puq/gnuplot/ to master, 2025-11-03

The patch is to make history function independent of readline. Also fix build error when enabling builtin readline but disabling history file. And can use the history file even when disabling all readlines (including the builtin one).

Commit Date  
[97948e] (history) by PuQ PuQ

fix build error if readline disabled and mouse support enabled

Thanks to Ethan Merritt

2025-11-02 02:40:18 Tree
[97f970] by PuQ PuQ

configure.ac: --without-readline now disables readline

--without-readline is no longer an alias for --with-readline=builtin

2025-11-02 02:40:18 Tree
[d40484] by PuQ PuQ

make `show plot add2history` work if history file enabled

2025-11-01 02:34:42 Tree
[631bf3] by PuQ PuQ

add line to history if readline or history file enabled

2025-10-27 10:12:59 Tree
[63f7fb] by PuQ PuQ

make history command work when history file is enabled but readline disabled

2025-10-27 09:39:56 Tree
[718855] by PuQ PuQ

history: fix build with history file enabled and any readline disabled

even when the built-in readline is also disabled

2025-10-27 07:08:56 Tree
[7b59dc] by PuQ PuQ

history: remove unused functions

2025-10-27 06:06:23 Tree

Discussion

  • Ethan Merritt

    Ethan Merritt - 2025-11-03

    With these commits in place, after "./configure --without-readline" the build fails with the following error sequence:

    term.c: In function term_waitforinput:
    term.c:1468:9: warning: implicit declaration of function raw [-Wimplicit-function-declaration]
     1468 |         raw();
          |         ^~~
    term.c:1469:20: error: called object nextchar is not a function or function pointer
     1469 |         nextchar = nextchar();
          |                    ^~~~~~~~
    term.c:1461:9: note: declared here
     1461 |     int nextchar;
          |         ^~~~~~~~
    term.c:1476:13: warning: implicit declaration of function cook [-Wimplicit-function-declaration]
     1476 |             cook();
          |             ^~~~
    term.c:1483:29: error: called object nextchar is not a function or function pointer
     1483 |             if ((nextchar = nextchar()) == '[') {
          |                             ^~~~~~~~
    term.c:1461:9: note: declared here
     1461 |     int nextchar;
          |         ^~~~~~~~
    term.c:1484:28: error: called object nextchar is not a function or function pointer
     1484 |                 nextchar = nextchar();
          |                            ^~~~~~~~
    term.c:1461:9: note: declared here
     1461 |     int nextchar;
          |         ^~~~~~~~
    make[2]: *** [Makefile:1030: term.o] Error 1
    

    It probably wants something like

    diff --git a/src/term.c b/src/term.c
    index 9de99a7f8..da137b8c0 100644
    --- a/src/term.c
    +++ b/src/term.c
    @@ -1453,6 +1453,10 @@ null_dashtype(int type, t_dashtype *custom_dash_pattern)
       #define raw() set_termio()
       #define cook() reset_termio()
       #define nextchar() fgetc(stdin)
    +#else
    +  #define raw()
    +  #define cook()
    +  #define nextchar() fgetc(stdin)
     #endif
    
     int
    
     
    • PuQ

      PuQ - 2025-11-03

      Thank you for the fix.

      By the way, there are some HAVE_WINEDITLINE in the codebase, but it doesn't seem to be in any config files. Does gnuplot actually support it?

      src/history.c
      301:#if defined(READLINE) || defined(HAVE_WINEDITLINE)
      
      src/gp_hist.h
      52:#elif defined(HAVE_LIBEDITLINE) || defined(HAVE_WINEDITLINE)
      53-/* NetBSD editline / WinEditLine
      
      src/syscfg.h
      373:#if defined(READLINE) || defined(HAVE_LIBREADLINE) || defined(HAVE_LIBEDITLINE) || defined(HAVE_WINEDITLINE)
      
       
  • Ethan Merritt

    Ethan Merritt - 2025-11-03

    By the way, there are some HAVE_WINEDITLINE in the codebase, but it doesn't seem to be in any config files. Does gnuplot actually support it?

    There is an editline library implementation for Windows with that name. I don't know whether any of the gnuplot Windows builds use it, or used it in the past.

     

Log in to post a comment.