Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Company mode freezes Emacs after run-racket #359

Closed
hencq opened this issue Feb 7, 2019 · 2 comments
Closed

Company mode freezes Emacs after run-racket #359

hencq opened this issue Feb 7, 2019 · 2 comments
Labels

Comments

@hencq
Copy link
Contributor

hencq commented Feb 7, 2019

After updating racket-mode, company-mode started freezing Emacs. I noticed this only happens after I run run-racket. Before that it works fine. Disabling company-mode fixes it.

After digging around a little bit, it seems that it happens due to a call to

(racket--cmd/await `(path+md5))

which gives a "racket-command process timeout" error. The problem goes away when in command-server.rkt I change

[`(path+md5)  (cons (or path 'top) md5)]

to

[`(path+md5) (cons 'top "")                                     ]

I tried digging around a little bit more in there, but got stuck. Happy to provide more details though if that's useful.

See below for debugging details:

``` ((emacs-version "26.1") (emacs-uptime "52 minutes, 36 seconds") (system-type darwin) (major-mode racket-mode) (racket--el-source-dir "/Users/usernam/.emacs.d/elpa/racket-mode-20190206.134/") (racket--rkt-source-dir "/Users/username/.emacs.d/elpa/racket-mode-20190206.134/racket/") (racket-program "racket") (racket-command-port 55555) (racket-command-timeout 10) (racket-memory-limit 2048) (racket-error-context medium) (racket-retry-as-skeleton t) ...) (enabled-minor-modes (auto-composition-mode) (auto-compression-mode) (auto-encryption-mode) (auto-fill-mode) (auto-save-mode) (blink-cursor-mode) (column-number-mode) (company-mode) (diff-auto-refine-mode) (electric-indent-mode) (file-name-shadow-mode) ...) (disabled-minor-modes (abbrev-mode) (auto-complete-mode) (auto-fill-function) (auto-save-visited-mode) (beancount-mode) (buffer-read-only) (cl-old-struct-compat-mode) (company-search-mode) (compilation-in-progress) (compilation-minor-mode) (compilation-shell-minor-mode) ...) ```
@hencq
Copy link
Contributor Author

hencq commented Feb 7, 2019

Digging into it some more, I saw the last commit touched paths as well. I think the issue is in

(define (path->string/emacs p)
    (match (map path->string (explode-path p))
     [(list* (pregexp "([a-zA-z]:)\\\\" (list _ drive)) vs)
     #:when (eq? 'windows (system-type))
      (string-join (cons drive vs))]
     [_ p]))

For non-windows systems (I'm on a Mac) the new commit doesn't translate back to a string. Wrapping that p in a path->string seems to fix the issue for me:

(define (path->string/emacs p)
    (match (map path->string (explode-path p))
     [(list* (pregexp "([a-zA-z]:)\\\\" (list _ drive)) vs)
     #:when (eq? 'windows (system-type))
      (string-join (cons drive vs))]
     [_ (path->string p)]))

hencq pushed a commit to hencq/racket-mode that referenced this issue Feb 8, 2019
…ed by f7d37a5

path->string/emacs returns a path if it was passed a path. This fix
makes it return a string.
greghendershott pushed a commit that referenced this issue Feb 8, 2019
path->string/emacs returns a path if it was passed a path. This fix
makes it return a string.
@greghendershott
Copy link
Owner

Fixed in commit d1e5a35.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants