使用emacs-live加载emacs时出错 [英] Error when loading emacs with emacs-live

查看:244
本文介绍了使用emacs-live加载emacs时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我启动emacs时,我收到错误

When I start emacs I get the error

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  string-match("cmd\\.exe" nil)
  (if (string-match "cmd\\.exe" tramp-encoding-shell) "/c" "-c")
  eval((if (string-match "cmd\\.exe" tramp-encoding-shell) "/c" "-c"))

当加载magit包时,似乎发生这种情况

this appears to occur when loading the magit pack

  eval-buffer(#<buffer  *load*-330059> nil "c:/cygwin64/home/johnstonk/.emacs.d/emacs-live/packs/stable/git-pack/lib/magit/magit.el" nil t)  ; Reading at buffer position 3100

我确认这是一个新的git克隆的emacs-live。
我尝试删除magit包加载在活动的init文件,但是当加载clojure包时,我再次收到相同的错误。

I confirmed this occurs with a fresh git clone of emacs-live. I tried removing the magit pack from loading in the live init file but I got the same error again when it loaded the clojure pack. Looks like a nil string error in tramp.

有没有人知道为什么?

推荐答案

通过并加载tramp-sh.el的源代码,我得到相同的(错误类型参数stringp nil)在第一行(require'tramp)

Going through and loading the source code for tramp-sh.el I got the same (wrong-type-argument stringp nil) on the first line (require 'tramp)

所以我加载了tramp.el(版本22.1),并得到了

So I loaded tramp.el (version 22.1) and got to the section

(defcustom tramp-encoding-shell
  (if (memq system-type '(windows-nt))
      (getenv "COMSPEC")...

我注意到这个系统类型正在设置为windows-nt (应该是,我在Windows7上),但是(getenvCOMSPEC)正在返回零,从我在其他地方googled的COMSPEC环境变量预计将存在于Windows机器并指向shell。Tramp使用 tramp-encoding-shell var在本地机器上编码和解码命令,例如〜 - 至少根据tramps评论。

I noticed that this system-type is getting set to windows-nt (As it should, I'm on windows7) but (getenv "COMSPEC") is returning nil. From what I googled elsewhere this COMSPEC environment variable is expected to exist on windows machines and point to the shell. Tramp uses the tramp-encoding-shell var for encoding and decoding commands on the local machine such as "~" -- at least according to tramps comments.

COMSPEC作为系统环境变量不存在,所以我创建了它,并将其指向cmd.exe C:\Windows\System32\cmd.exe 为我修复了。

COMSPEC didn't exist as an system environment variable for me so I created it and pointed it to cmd.exe C:\Windows\System32\cmd.exe That fixed it for me.

注意不要将COMSPEC设置为powerhell,当我尝试使用lein(不断尝试创建服务器,失败,并再次尝试但不清除以前的线程)时,一个讨厌的内存泄漏。

Note don't set COMSPEC to powershell, I tried that first but got a nasty memory leak when I tried to use lein (keeps trying to create a server, fails, and tries again but doesn't clean up previous thread).

这篇关于使用emacs-live加载emacs时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆