Commits

Ivan Andrus committed 1fcb5df

Move point to process-mark so output doesn't get jumbled
gap-eval-* now display the GAP process in another window

Comments (0)

Files changed (1)

   (interactive "r")
   (ensure-gap-running nil)
   (let ((process (get-buffer-process gap-process-buffer)))
-    (setq gap-send-state 'echo)
-    ;; (setq gap-send-state 'normal)
+    (setq gap-send-state 'normal)
     (set-process-filter process 'gap-output-filter)
-    (comint-send-region process begin end)))
+    (display-buffer (process-buffer process))
+    (with-current-buffer gap-process-buffer
+      (goto-char (process-mark process)))
+    (comint-send-region process begin end)
+    (when (not (string= "\n" (buffer-substring-no-properties (- end 1) end)))
+      (comint-send-string process "\n"))))
 
 (defun gap-eval-string (buf-str)
   "Send string BUF-STR to GAP interpreter.
 depending on the value of `gap-auto-start-gap'."
   (ensure-gap-running nil)
   (let ((process (get-buffer-process gap-process-buffer)))
-    ;; (setq gap-send-state 'echo) ;; This only hides the first line...
     (setq gap-send-state 'normal)
     (set-process-filter process 'gap-output-filter)
+    (display-buffer (process-buffer process))
+    (with-current-buffer gap-process-buffer
+      (goto-char (process-mark process)))
     (comint-send-string process
                          (if (string-match "\n\\'" buf-str)
                              buf-str
                (y-or-n-p "Save current buffer? ")
                (save-buffer))
           (list (buffer-file-name))))
-
   (gap-eval-string (concat "Read(\"" file "\");")))
 
 (defun gap-eval-defun ()