guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] GNU Guile branch, master, updated. release_1-9-13-51-g8b


From: Andy Wingo
Subject: [Guile-commits] GNU Guile branch, master, updated. release_1-9-13-51-g8b755a7
Date: Sun, 14 Nov 2010 21:54:05 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".

http://git.savannah.gnu.org/cgit/guile.git/commit/?id=8b755a759eb7d07e82285e925bae02c19e7a3107

The branch, master has been updated
       via  8b755a759eb7d07e82285e925bae02c19e7a3107 (commit)
      from  d9f00c3db598955db75047aa805adf16a7bb2421 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 8b755a759eb7d07e82285e925bae02c19e7a3107
Author: Neil Jerram <address@hidden>
Date:   Sat Oct 30 16:28:54 2010 +0100

    Expression-oriented readline history
    
    * guile-readline/ice-9/readline.scm (make-readline-port): Instead of
      calling add-history after every %readline call, do it only when
      starting a new read.  Other times, append the line just read to an
      internal buffer.

-----------------------------------------------------------------------

Summary of changes:
 guile-readline/ice-9/readline.scm |   43 +++++++++++++++++++++++++------------
 1 files changed, 29 insertions(+), 14 deletions(-)

diff --git a/guile-readline/ice-9/readline.scm 
b/guile-readline/ice-9/readline.scm
index 4879bab..36f805f 100644
--- a/guile-readline/ice-9/readline.scm
+++ b/guile-readline/ice-9/readline.scm
@@ -80,20 +80,35 @@
 (define read-hook #f)
 
 (define (make-readline-port)
-  (make-line-buffered-input-port (lambda (continuation?)
-                                   (let* ((prompt (if continuation?
-                                                      continuation-prompt
-                                                      new-input-prompt))
-                                          (str (%readline (if (string? prompt)
-                                                              prompt
-                                                              (prompt))
-                                                          input-port
-                                                          output-port
-                                                          read-hook)))
-                                     (or (eof-object? str)
-                                         (string=? str "")
-                                         (add-history str))
-                                     str))))
+  (let ((history-buffer #f))
+    (make-line-buffered-input-port (lambda (continuation?)
+                                     ;; When starting a new read, add
+                                     ;; the previously read expression
+                                     ;; to the history.
+                                     (if (and (not continuation?)
+                                              history-buffer)
+                                         (begin
+                                           (add-history history-buffer)
+                                           (set! history-buffer #f)))
+                                     ;; Set up prompts and read a line.
+                                     (let* ((prompt (if continuation?
+                                                        continuation-prompt
+                                                        new-input-prompt))
+                                            (str (%readline (if (string? 
prompt)
+                                                                prompt
+                                                                (prompt))
+                                                            input-port
+                                                            output-port
+                                                            read-hook)))
+                                       (or (eof-object? str)
+                                           (string=? str "")
+                                           (set! history-buffer
+                                                 (if history-buffer
+                                                     (string-append 
history-buffer
+                                                                    " "
+                                                                    str)
+                                                     str)))
+                                       str)))))
 
 ;;; We only create one readline port.  There's no point in having
 ;;; more, since they would all share the tty and history ---


hooks/post-receive
-- 
GNU Guile



reply via email to

[Prev in Thread] Current Thread [Next in Thread]