idris-mode –缓冲区没有进程 [英] idris-mode – Buffer has no process
问题描述
我是emacs的新手(来自vim,在这里我无法使idris-vim正常工作)并通过el-get安装了这些软件包:
I'm new to emacs (coming from vim, where I can't get idris-vim to work) and have these packages installed via el-get:
ace-jump-mode installed A quick cursor location minor mode for emacs.
el-get installed Manage the external elisp bits and pieces you depend upon.
evil-leader installed Add <leader> shortcuts to Evil, the extensible vim emulation layer
evil-numbers installed Increment/decrement numbers in Evil, the extensible vim emulation layer. Like C-a/C-x in vim. After installation, you will need to add a key-binding for evil-numbers. For example: (define-key evil-normal-state-map (kbd "C-c +") 'evil-numbers/inc-at-pt) (define-key evil-normal-state-map (kbd "C-c -") 'evil-numbers/dec-at-pt)
evil-surround installed Emulate Tim Pope's surround.vim in evil, the extensible vim emulation layer for emacs
evil installed Evil is an extensible vi layer for Emacs. It emulates the main features of Vim, and provides facilities for writing custom extensions.
goto-chg installed Goto the point of the most recent edit in the buffer.
haskell-mode installed A Haskell editing mode
idris-mode installed Major mode for the Idris language
j-mode installed Emacs major mode for editing J code.
linum-relative installed Display relative line number in the left margin
undo-tree installed Treat undo history as a tree
我的〜/.emacs.d/init.el看起来像这样:
My ~/.emacs.d/init.el looks like this:
(add-to-list 'load-path "~/.emacs.d/")
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d//ac-dict")
(ac-config-default)
(setq mouse-wheel-scroll-amount '(1 ((shift) . 1)))
(setq mouse-wheel-progressive-speed nil)
(setq mouse-wheel-f 't)
(setq scroll-s 1)
(add-to-list 'load-path "~/.emacs.d/lojban")
(autoload 'lojban-parse-region "lojban" nil t)
(autoload 'lojban-mode "lojban-mode" nil t)
(add-to-list 'load-path "~/.emacs.d/el-get/el-get")
(unless (require 'el-get nil 'noerror)
(with-current-buffer
(url-retrieve-synchronously
"https://raw.github.com/dimitri/el-get/master/el-get-install.el")
(goto-char (point-max))
(eval-print-last-sexp)))
(add-to-list 'el-get-recipe-path "~/.emacs.d/el-get-user/recipes")
(el-get 'sync)
(add-to-list 'load-path "~/.emacs.d/j-mode/")
(autoload 'j-mode "j-mode.el" "Major mode for editing J files" t)
(add-to-list 'auto-mode-alist '("\\.ij[rstp]$" . j-mode))
;(custom-set-face
; '(j-verb-face ((t (:foreground "cornflower blue"))))
; '(j-adverb-face ((t (:foreground "goldenrod"))))
; '(j-conjunction-face ((t (:foreground "olive drab"))))
; '(j-other-face ((t (:foreground "Black")))))
(require 'evil-leader)
(global-evil-leader-mode)
(add-to-list 'load-path "~/.emacs.d/evil")
(require 'evil)
(evil-mode 1)
;(require 'lalopmak-evil)
(define-key evil-normal-state-map "," 'evil-ex)
(define-key evil-motion-state-map ":" 'evil-repeat-find-char-reverse)
(define-key evil-window-map "j" 'evil-window-left)
(define-key evil-window-map "J" 'evil-window-move-far-left)
(define-key evil-window-map "k" 'evil-window-down)
(define-key evil-window-map "K" 'evil-window-move-very-bottom)
(define-key evil-window-map "h" 'evil-window-up)
(define-key evil-window-map "H" 'evil-window-move-very-top)
(define-key evil-motion-state-map "j" 'evil-backward-char)
(define-key evil-motion-state-map "J" 'evil-window-top)
(define-key evil-motion-state-map "k" 'evil-next-line)
(define-key evil-motion-state-map "h" 'evil-previous-line)
(define-key evil-motion-state-map (kbd "C-n") 'evil-scroll-line-up)
(define-key evil-normal-state-map (kbd "M-x") 'execute-extended-command)
由于我正在使用邪恶,并且idris-mode具有可与邪恶配合使用的绑定,因此我尝试遵循
Since I'm using evil, and idris-mode has bindings that work with evil, I tried to follow the case splitting example for vim. Starting from a fresh session, here's what happens:
- 我打开vadd.idr文件,该文件已经包含3行(其中1行为空白).
- 我移到最后一行,然后按
\d
. - 我收到一条很长的错误消息,该错误消息在我阅读之前就消失了.
- Idris REPL在新的拆分窗格中打开.
- 命令行(在窗口底部)显示
Buffer vadd.idr has no process
. 我还尝试了REPL,在插入模式下输入.按下回车键后,我得到Buffer *idris-repl* has no process
,然后再无任何反应.
- I open the vadd.idr file, which already contains 3 lines (1 of which is blank).
- I move to the last line and press
\d
. - I get a long error message, which disappears before I can read it.
- The Idris REPL opens in a new split pane.
- The command line (at the bottom of the window) shows
Buffer vadd.idr has no process
. I also try out the REPL, typing in insert mode. Upon pressing enter, I getBuffer *idris-repl* has no process
, and nothing further happens.
在Linux shell中,echo $PATH
生成/home/james/bin /home/james/.cabal/bin /home/james/bin /usr/local/sbin /usr/local/bin /usr/bin /usr/bin/vendor_perl /usr/bin/core_perl
,而idris
从shell正常工作.
In a Linux shell, echo $PATH
produces /home/james/bin /home/james/.cabal/bin /home/james/bin /usr/local/sbin /usr/local/bin /usr/bin /usr/bin/vendor_perl /usr/bin/core_perl
, and idris
works from the shell as expected.
当退出emacs时(通过一些ZZ
),我被告知存在活动进程.这是我显示的过程列表:
When exiting emacs (via a few ZZ
s), I'm told that active processes exist. Here's the process list I'm shown:
Process Status Buffer TTY Command
idris run *idris-process* /dev/pts/3 idris --ideslave-socket
因为它可能已连接,所以这是我使用idris-vim从vim中的同一文件得到的错误:
Because it may be connected, here's the error I get from the same file in vim, using idris-vim:
:call IdrisReload(0)
"vadd.idr" 3L, 62C written
Uncaught error: connect: does not exist (Connection refused)
Press ENTER or type command to continue
我使用ex命令是因为领导者绑定不起作用(还有另一个问题).
I use the ex command because the leader binding doesn't work (yet another issue I have).
很抱歉提出这么长的问题.我想包括最相关的信息,即使那意味着要添加不相关的内容.
Sorry for making such a long question. I wanted to include most relevant pieces of information, even if that meant adding irrelevant things.
修改:更多;我找到了调试器(从菜单中设置错误时输入调试器").
Edit: more; I found the debugger (setting "Enter Debugger on Error" from the menu).
我按\d
,然后在缓冲区中看到它:
I press \d
, then see this in a buffer:
Debugger entered--Lisp error: (file-error "make client process failed" "connection refused" :name "Idris Ideslave" :buffer "*idris-connection*" :host "127.0.0.1" :service 0 :nowait nil)
make-network-process(:name "Idris Ideslave" :buffer "*idris-connection*" :host "127.0.0.1" :service 0 :nowait nil)
open-network-stream("Idris Ideslave" "*idris-connection*" "127.0.0.1" 0)
idris-connect(0)
idris-process-filter(" ____ __ _ \n / _/___/ /____(_)____ \n / // __ / ___/ / ___/ Version 0.9.12\n _/ // /_/ / / / (__ ) http://www.idris-lang.org/ \n /___/\\__,_/_/ /_/____/ Type :? for help \n\n")
comint-output-filter(#<process idris> " ____ __ _ \n / _/___/ /____(_)____ \n / // __ / ___/ / ___/ Version 0.9.12\n _/ // /_/ / / / (__ ) http://www.idris-lang.org/ \n /___/\\__,_/_/ /_/____/ Type :? for help \n\n")
accept-process-output(#<process idris> 3)
idris-run()
idris-ensure-process-and-repl-buffer()
idris-load-file-sync()
idris-add-clause(nil)
call-interactively(idris-add-clause nil nil
并在ex命令行中查看
make client process failed: connection refused, :name, Idris Ideslave, :buffer, *idris-connection*, :host, 127.0.0.1, :service, 0, :nowait, nil
我不知道它要做什么.
编辑:这是vadd.idr缓冲区状态行的右端(正确的术语?):
Edit: Here's the right-hand end of vadd.idr's buffer's status line (correct term?):
(Idris (Not loaded) ElDoc Ind Undo-Tree)
Not loaded
看起来令人担忧,但我对此一无所知.
Not loaded
looks worrying, but I don't know any more about it.
编辑:回到Vim问题,我运行了
Edit: Going back to the Vim issue, I ran
$ vim -V9vimlog vadd.idr
:call IdrisReload(0)
ZZ
$ ack idris vimlog
日志中的所有内容看起来都很正常,直到结束(由于错误导致):
Everything from the log looks pretty normal, until the end (brought about by the error):
Calling shell to execute: "(idris --check vadd.idr) &> /tmp/vbKELys/1"
Error detected while processing function <SNR>38_BufWritePostHook..<SNR>38_UpdateErrors..<SNR>38_CacheErrors..16..15..SyntaxCheckers_idris_idris_GetLocList..SyntasticMake:
Calling shell to execute: "(idris --client ':l /mnt/sda9/home/james/Documents/idris/vadd.idr') >/tmp/vbKELys/2 2>&1"
因此,我发现该日志文件包含
So, I find that the log file includes
Calling shell to execute: "(idris --check vadd.idr) &> /tmp/vbKELys/1"
Error detected while processing function <SNR>38_BufWritePostHook..<SNR>38_UpdateErrors..<SNR>38_CacheErrors..16..15..SyntaxCheckers_idris_idris_GetLocList..SyntasticMake:
line 66:
E380: At bottom of quickfix stack
error list 1 of 1; 1 errors
Calling shell to execute: "(idris --client ':l /mnt/sda9/home/james/Documents/idris/vadd.idr') >/tmp/vbKELys/2 2>&1"
Uncaught error: connect: does not exist (Connection refused)
从shell运行这些shell命令,我得到:
Running those shell commands from the shell, I get:
$ idris --check vadd.idr
$ idris --client ':l /mnt/sda9/home/james/Documents/idris/vadd.idr'
Uncaught error: connect: does not exist (Connection refused)
$ idris --client vadd.idr
Uncaught error: connect: does not exist (Connection refused)
顺便说一下,
普通idris vaddr.idr
正常工作.
Plain idris vaddr.idr
works fine, by the way.
推荐答案
在我看来,您可能在Idris和idris-mode
之间的版本不匹配.最近,idris-mode
开始使用套接字与编译器进行通信,而不是使用stdin/stdout.如果您使用的是MELPA的idris-mode
,那将是预期的结果.通常,MELPA上的版本将需要编译器的最新Git版本. Github的最新标记版本(可在MELPA稳定版本中使用)将与最新版本的Idris一起使用.
It looks to me like you may have a version mismatch between Idris and idris-mode
. Somewhat recently, idris-mode
started using a socket to communicate with the compiler rather than stdin/stdout. If you're using idris-mode
from MELPA, that's what it will be expecting. Generally, the version on MELPA will require the latest Git version of the compiler. The latest tagged release from Github (available in MELPA-stable) will work with the latest release of Idris.
在Vim中,运行子进程比在Emacs中困难得多,因此在Vim中,您需要单独运行Idris REPL.然后使用--client
选项发送命令,这将导致命令在后台REPL中运行.此后台REPL应该具有正确的工作目录.我看到您在上面使用了--check
-这告诉Idris键入检查文件,然后退出.尝试在一个终端中启动REPL,然后在另一个终端中使用--client
.
In Vim, it's much more difficult to run a subprocess than it is in Emacs, so in Vim, you need to have a separate running Idris REPL. Commands are then sent using the --client
option, which causes the command to be run in the background REPL. This background REPL should have the correct working directory. I saw that you used --check
above - this tells Idris to type check a file and then exit. Try starting a REPL up in one terminal, then using --client
from another.
这篇关于idris-mode –缓冲区没有进程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!