Changeset 9164 in project for release/3/readline/readline.scm


Ignore:
Timestamp:
03/04/08 19:51:22 (12 years ago)
Author:
elf
Message:

new version. fixed multiple sessions clobbering each others histories.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • release/3/readline/readline.scm

    r8379 r9164  
    9797  gnu-readline-read-history
    9898  gnu-readline-write-history
     99  gnu-readline-append-history
    99100  gnu-readline-truncate-history
     101  gnu-history-new-lines
    100102  gnu-history-install-file-manager
    101103
     
    117119static int gnu_readline_paren_balance = 0;
    118120static int gnu_readline_brace_balance = 0;
     121static int gnu_history_newlines = 0;
    119122
    120123////\\\\//// Paren Bouncing ////\\\\////
     
    307310*/
    308311
     312int gnu_history_new_lines()
     313{
     314    return gnu_history_newlines;
     315}
     316
     317int gnu_readline_append_history(char *filename)
     318{
     319    return append_history(gnu_history_newlines, filename);
     320}
     321
    309322
    310323// Set everything up
     
    343356                if (NULL == h || 0 != strcmp(h->line, gnu_readline_buf)) {
    344357                        add_history(gnu_readline_buf);
     358                        gnu_history_newlines++;
    345359                }
    346360        }
     
    386400  (foreign-lambda int "write_history" c-string))
    387401
     402(define gnu-readline-append-history
     403    (foreign-lambda int "gnu_readline_append_history" c-string))
     404
    388405;;; (gnu-readline-truncate-history <filename-or-false> <numlines>) -> 0 succ, errno fail
    389406(define gnu-readline-truncate-history
    390407  (foreign-lambda int "history_truncate_file" c-string int))
     408
     409(define gnu-history-new-lines
     410    (foreign-lambda int "gnu_history_new_lines"))
    391411
    392412;; Useful...
     
    406426    (param (let ((next (param)))
    407427             (lambda args
    408                (gnu-readline-write-history filename)
     428               ;(gnu-readline-write-history filename)
     429               (gnu-readline-append-history filename)
    409430               (apply next args)))))
    410431  (if (pair? nlines)
Note: See TracChangeset for help on using the changeset viewer.