~eshel/sweep

9ea7cd7c5af3cdc79c6a821b5c090d5e0d141646 — Eshel Yaron 6 months ago dca6465
Fix top-level buffer to thread id association

* sweeprolog.el (sweeprolog-top-level-buffer): Fix thinko.
* sweeprolog-tests.el (backward-sexp-over-char-literal): New test.
2 files changed, 15 insertions(+), 5 deletions(-)

M sweeprolog-tests.el
M sweeprolog.el
M sweeprolog-tests.el => sweeprolog-tests.el +8 -0
@@ 1873,6 1873,14 @@ head,
  (forward-sexp)
  (should (= (point) 21)))

(ert-deftest top-level-thread-id ()
  "Test obtaining the thread id of a top-level on startup."
  (let ((buf-name (generate-new-buffer-name "*test top-level*")))
    (sweeprolog-top-level buf-name)
    (should sweeprolog-top-level-thread-id)
    (sweeprolog-top-level-delete-process buf-name)
    (kill-buffer buf-name)))

(sweeprolog-deftest usage-example-comment ()
  "Tests adding usage example comments."
  "\nfoo."

M sweeprolog.el => sweeprolog.el +7 -5
@@ 3509,11 3509,13 @@ top-level."
                    (let* ((proc (get-buffer-process buf))
                           (tty (process-tty-name proc)))
                      (process-send-eof proc)
                      (sweeprolog--query-once "sweep" "sweep_top_level_start_pty" tty)
                      (unless comint-last-prompt buf (accept-process-output proc 1))
                      (when (eq system-type 'gnu/linux)
                        ;; make sure the pty does not echo input
                        (call-process "stty" nil nil nil "-F" tty "-echo"))))
                      (prog1 (sweeprolog--query-once
                              "sweep" "sweep_top_level_start_pty" tty)
                        (unless comint-last-prompt buf
                                (accept-process-output proc 1))
                        (when (eq system-type 'gnu/linux)
                          ;; make sure the pty does not echo input
                          (call-process "stty" nil nil nil "-F" tty "-echo")))))
                (unless sweeprolog-prolog-server-port
                  (sweeprolog-start-prolog-server))
                (make-comint-in-buffer "sweeprolog-top-level"