GNU bug report logs - #61350
Eglot over Tramp freezes with large project

Previous Next

Package: emacs;

Reported by: Thomas Koch <thomas <at> koch.ro>

Date: Tue, 7 Feb 2023 18:49:02 UTC

Severity: normal

Full log


View this message in rfc822 format

From: João Távora <joaotavora <at> gmail.com>
To: Jim Porter <jporterbugs <at> gmail.com>
Cc: Thomas Koch <thomas <at> koch.ro>, Michael Albinus <michael.albinus <at> gmx.de>, Stefan Monnier <monnier <at> iro.umontreal.ca>, 61350 <at> debbugs.gnu.org
Subject: bug#61350: Eglot over Tramp freezes with large project
Date: Thu, 16 Mar 2023 15:58:58 +0000
João Távora <joaotavora <at> gmail.com> writes:

> Jim Porter <jporterbugs <at> gmail.com> writes:
>    (setq answer-from-proc (catch 'done
>                             (process-put proc 'busy t)
>                             (process-send-string proc "OPEN THE POD BAY DOORS\n")
>                             (while (accept-process-output))))
>
> This is very simplified (and untested), but that's the gist.  

The gist it is, but also very broken.  As ever, vapourware sucks. This
is what that snippet should have been:

  ;;; hal.el --- asdasd                                -*- lexical-binding: t; -*-
  (defvar hal-proc nil)
  (defun hal-connect()
    (interactive)
    (when (processp hal-proc) (delete-process hal-proc))
    (setq hal-proc
          (make-process
           :name "halproc"
           :command (list (expand-file-name "hal" default-directory))
           :buffer (generate-new-buffer "*halbuf*")
           :filter (lambda (proc output)
                     (internal-default-process-filter proc output)
                     (when-let* ((buffer (process-buffer proc))
                                 (callback (and (buffer-live-p buffer)
                                                (process-get proc 'callback))))
                       (with-current-buffer buffer
                         (save-excursion
                           (goto-char (point-min))
                           (when (search-forward ", DAVE\n" nil t)
                             (unwind-protect (funcall callback
                                                      (buffer-substring
                                                       (point-min) (point)))
                               (process-put proc 'callback nil)
                               (delete-region (point-min)
                               (point)))))))))))
   
  (defun hal-command ()  "Synch command to HAL that doesn't block others."
    (interactive)
    (message
     (catch 'hal-done
       (process-put hal-proc 'callback
                    (lambda (result) (throw 'hal-done result)))
       (process-send-string hal-proc "OPEN THE POD BAY DOORS!\n")
       (while (accept-process-output hal-proc)))))

You can test this with this very complex C++ program
    
   #include <cstdlib>
   #include <iostream>
   #include <string>
   #include <array>
    
   int main() {
     std::string line;
     const char* retorts[] = {
       "I'M AFRAID I CAN'T DO THAT",
       "I'D RATHER NOT",
       "THINK OF THE CONSEQUENCES",
       "PLEASE STOP"
     };
     while (std::cin >> line)
       std::cout << retorts[std::rand()%4] << ", DAVE" << std::endl;
   }




This bug report was last modified 2 years and 49 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.