[slime-cvs] CVS update: slime/slime.el

Helmut Eller heller at common-lisp.net
Mon Dec 13 20:05:23 UTC 2004


Update of /project/slime/cvsroot/slime
In directory common-lisp.net:/tmp/cvs-serv18869

Modified Files:
	slime.el 
Log Message:
(slime-repl-grab-old-input): Append the old input to the current
input by default.  If the new `replace' argument and is true, replace
the current input.
Date: Mon Dec 13 21:05:19 2004
Author: heller

Index: slime/slime.el
diff -u slime/slime.el:1.436 slime/slime.el:1.437
--- slime/slime.el:1.436	Mon Dec 13 20:54:23 2004
+++ slime/slime.el	Mon Dec 13 21:05:16 2004
@@ -2720,7 +2720,7 @@
   (slime-check-connected)
   (assert (<= (point) slime-repl-input-end-mark))
   (cond ((get-text-property (point) 'slime-repl-old-input)
-         (slime-repl-grab-old-input))
+         (slime-repl-grab-old-input end-of-input))
         (end-of-input
          (slime-repl-send-input))
         (slime-repl-read-mode ; bad style?
@@ -2749,9 +2749,11 @@
     (slime-mark-output-start)
     (slime-repl-send-string input)))
 
-(defun slime-repl-grab-old-input ()
-  "Resend the old REPL input at point.
-The old input has the text property `slime-repl-old-input'."
+(defun slime-repl-grab-old-input (replace)
+  "Resend the old REPL input at point.  
+If replace it non-nil the current input is replaced with the old
+input; otherwise the new input is appended.  The old input has the
+text property `slime-repl-old-input'."
   (let ((prop 'slime-repl-old-input))
     (let* ((beg (save-excursion
                   ;; previous-single-char-property-change searches for
@@ -2764,7 +2766,10 @@
                   (previous-single-char-property-change (point) prop)))
            (end (next-single-char-property-change (point) prop))
            (old-input (buffer-substring beg end)))
-      (goto-char slime-repl-input-start-mark)
+      (cond (replace (goto-char slime-repl-input-start-mark))
+            (t (goto-char slime-repl-input-end-mark)
+               (unless (eq (char-before) ?\ )
+                 (insert " "))))
       (delete-region (point) slime-repl-input-end-mark)
       (insert old-input)
       (while (eq (char-before) ?\n)




More information about the slime-cvs mailing list