- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我最近安装了 Emacs 24.3 并尝试使用它为 Python 编码(v3.3.2 x86-64 MSI 安装程序)。 (我是 Emacs 的新手)。然后我尝试通过将 zip 解压缩到
来安装 emacs-for-python"C:\Users\mmsc\AppData\Roaming\.emacs.d\emacs-for-python"
文件夹并添加
: (load-file "~/.emacs.d/emacs-for-python/epy-init.el")
进入 C:\Users\mmsc\AppData\Roaming.emacs
启动 Emacs 后,我看到错误
Warning (initialization): An error occurred while loading `c:/Users/Klein/AppData/Roaming/.emacs':
error: Pymacs helper did not start within 30 seconds
To ensure normal operation, you should investigate and remove the cause of the error in your initialization file. Start Emacs with the `--debug-init' option to view a complete error backtrace.
通过“--debug-init”,我看到了下面的信息,但我对Emacs/Lisp了解不多,所以我不能轻易定位问题。
Debugger entered--Lisp error: (error "Pymacs helper did not start within 30 seconds")
signal(error ("Pymacs helper did not start within 30 seconds"))
pymacs-report-error("Pymacs helper did not start within %d seconds" 30)
(if (accept-process-output process pymacs-timeout-at-start) nil (pymacs-report-error "Pymacs helper did not start within %d seconds" pymacs-timeout-at-start))
(while (progn (goto-char (point-min)) (not (re-search-forward "<\\([0-9]+\\) " nil t))) (if (accept-process-output process pymacs-timeout-at-start) nil (pymacs-report-error "Pymacs helper did not start within %d seconds" pymacs-timeout-at-start)))
(let ((process (apply (quote start-process) "pymacs" buffer (let ((python (getenv "PYMACS_PYTHON"))) (if (or (null python) (equal python "")) pymacs-python-command python)) "-c" (concat "import sys;" " from Pymacs import main;" " main(*sys.argv[1:])") (append (and (>= emacs-major-version 24) (quote ("-f"))) (mapcar (quote expand-file-name) pymacs-load-path))))) (pymacs-kill-without-query process) (while (progn (goto-char (point-min)) (not (re-search-forward "<\\([0-9]+\\) " nil t))) (if (accept-process-output process pymacs-timeout-at-start) nil (pymacs-report-error "Pymacs helper did not start within %d seconds" pymacs-timeout-at-start))) (let ((marker (process-mark process)) (limit-position (+ (match-end 0) (string-to-number (match-string 1))))) (while (< (marker-position marker) limit-position) (if (accept-process-output process pymacs-timeout-at-start) nil (pymacs-report-error "Pymacs helper probably was interrupted at start")))))
(progn (let ((process (apply (quote start-process) "pymacs" buffer (let ((python ...)) (if (or ... ...) pymacs-python-command python)) "-c" (concat "import sys;" " from Pymacs import main;" " main(*sys.argv[1:])") (append (and (>= emacs-major-version 24) (quote ...)) (mapcar (quote expand-file-name) pymacs-load-path))))) (pymacs-kill-without-query process) (while (progn (goto-char (point-min)) (not (re-search-forward "<\\([0-9]+\\) " nil t))) (if (accept-process-output process pymacs-timeout-at-start) nil (pymacs-report-error "Pymacs helper did not start within %d seconds" pymacs-timeout-at-start))) (let ((marker (process-mark process)) (limit-position (+ (match-end 0) (string-to-number (match-string 1))))) (while (< (marker-position marker) limit-position) (if (accept-process-output process pymacs-timeout-at-start) nil (pymacs-report-error "Pymacs helper probably was interrupted at start"))))) (goto-char (match-end 0)) (let ((reply (read (current-buffer)))) (if (and (pymacs-proper-list-p reply) (= (length reply) 2) (eq (car reply) (quote version))) (if (string-equal (cadr reply) "0.25") nil (pymacs-report-error "Pymacs Lisp version is 0.25, Python is %s" (cadr reply))) (pymacs-report-error "Pymacs got an invalid initial reply"))))
(unwind-protect (progn (let ((process (apply (quote start-process) "pymacs" buffer (let (...) (if ... pymacs-python-command python)) "-c" (concat "import sys;" " from Pymacs import main;" " main(*sys.argv[1:])") (append (and ... ...) (mapcar ... pymacs-load-path))))) (pymacs-kill-without-query process) (while (progn (goto-char (point-min)) (not (re-search-forward "<\\([0-9]+\\) " nil t))) (if (accept-process-output process pymacs-timeout-at-start) nil (pymacs-report-error "Pymacs helper did not start within %d seconds" pymacs-timeout-at-start))) (let ((marker (process-mark process)) (limit-position (+ (match-end 0) (string-to-number ...)))) (while (< (marker-position marker) limit-position) (if (accept-process-output process pymacs-timeout-at-start) nil (pymacs-report-error "Pymacs helper probably was interrupted at start"))))) (goto-char (match-end 0)) (let ((reply (read (current-buffer)))) (if (and (pymacs-proper-list-p reply) (= (length reply) 2) (eq (car reply) (quote version))) (if (string-equal (cadr reply) "0.25") nil (pymacs-report-error "Pymacs Lisp version is 0.25, Python is %s" (cadr reply))) (pymacs-report-error "Pymacs got an invalid initial reply")))) (set-match-data save-match-data-internal (quote evaporate)))
(let ((save-match-data-internal (match-data))) (unwind-protect (progn (let ((process (apply (quote start-process) "pymacs" buffer (let ... ...) "-c" (concat "import sys;" " from Pymacs import main;" " main(*sys.argv[1:])") (append ... ...)))) (pymacs-kill-without-query process) (while (progn (goto-char (point-min)) (not (re-search-forward "<\\([0-9]+\\) " nil t))) (if (accept-process-output process pymacs-timeout-at-start) nil (pymacs-report-error "Pymacs helper did not start within %d seconds" pymacs-timeout-at-start))) (let ((marker (process-mark process)) (limit-position (+ ... ...))) (while (< (marker-position marker) limit-position) (if (accept-process-output process pymacs-timeout-at-start) nil (pymacs-report-error "Pymacs helper probably was interrupted at start"))))) (goto-char (match-end 0)) (let ((reply (read (current-buffer)))) (if (and (pymacs-proper-list-p reply) (= (length reply) 2) (eq (car reply) (quote version))) (if (string-equal (cadr reply) "0.25") nil (pymacs-report-error "Pymacs Lisp version is 0.25, Python is %s" (cadr reply))) (pymacs-report-error "Pymacs got an invalid initial reply")))) (set-match-data save-match-data-internal (quote evaporate))))
(save-current-buffer (set-buffer buffer) (erase-buffer) (buffer-disable-undo) (pymacs-set-buffer-multibyte nil) (set-buffer-file-coding-system (quote raw-text)) (let ((save-match-data-internal (match-data))) (unwind-protect (progn (let ((process (apply ... "pymacs" buffer ... "-c" ... ...))) (pymacs-kill-without-query process) (while (progn (goto-char ...) (not ...)) (if (accept-process-output process pymacs-timeout-at-start) nil (pymacs-report-error "Pymacs helper did not start within %d seconds" pymacs-timeout-at-start))) (let ((marker ...) (limit-position ...)) (while (< ... limit-position) (if ... nil ...)))) (goto-char (match-end 0)) (let ((reply (read ...))) (if (and (pymacs-proper-list-p reply) (= ... 2) (eq ... ...)) (if (string-equal ... "0.25") nil (pymacs-report-error "Pymacs Lisp version is 0.25, Python is %s" ...)) (pymacs-report-error "Pymacs got an invalid initial reply")))) (set-match-data save-match-data-internal (quote evaporate)))))
(let ((buffer (get-buffer-create "*Pymacs*"))) (save-current-buffer (set-buffer buffer) (erase-buffer) (buffer-disable-undo) (pymacs-set-buffer-multibyte nil) (set-buffer-file-coding-system (quote raw-text)) (let ((save-match-data-internal (match-data))) (unwind-protect (progn (let ((process ...)) (pymacs-kill-without-query process) (while (progn ... ...) (if ... nil ...)) (let (... ...) (while ... ...))) (goto-char (match-end 0)) (let ((reply ...)) (if (and ... ... ...) (if ... nil ...) (pymacs-report-error "Pymacs got an invalid initial reply")))) (set-match-data save-match-data-internal (quote evaporate))))) (if (not pymacs-use-hash-tables) (setq pymacs-weak-hash t) (if pymacs-used-ids (progn (let ((pymacs-transit-buffer buffer) (pymacs-forget-mutability t) (pymacs-gc-inhibit t)) (pymacs-call "zombie_python" pymacs-used-ids)) (setq pymacs-used-ids nil))) (setq pymacs-weak-hash (make-hash-table :weakness (quote value))) (if (boundp (quote post-gc-hook)) (add-hook (quote post-gc-hook) (quote pymacs-schedule-gc)) (setq pymacs-gc-timer (run-at-time 20 20 (quote pymacs-schedule-gc))))) (setq pymacs-transit-buffer buffer) (let ((modules pymacs-load-history)) (setq pymacs-load-history nil) (if (and modules (yes-or-no-p "Reload modules in previous session? ")) (progn (mapc (function (lambda (args) (condition-case err ... ...))) modules)))))
pymacs-start-services()
(if (and pymacs-transit-buffer (buffer-name pymacs-transit-buffer) (get-buffer-process pymacs-transit-buffer)) nil (if pymacs-weak-hash (progn (if (or (eq pymacs-auto-restart t) (and (eq pymacs-auto-restart (quote ask)) (yes-or-no-p "The Pymacs helper died. Restart it? "))) nil (pymacs-report-error "There is no Pymacs helper!")))) (pymacs-start-services))
pymacs-serve-until-reply("eval" (pymacs-print-for-apply (quote "pymacs_load_helper") (quote ("ropemacs" "rope-" nil))))
pymacs-call("pymacs_load_helper" "ropemacs" "rope-" nil)
(let ((lisp-code (pymacs-call "pymacs_load_helper" module prefix noerror))) (cond (lisp-code (let ((result (eval lisp-code))) (add-to-list (quote pymacs-load-history) (list module prefix noerror) (quote append)) (message "Pymacs loading %s...done" module) (run-hook-with-args (quote pymacs-after-load-functions) module) result)) (noerror (message "Pymacs loading %s...failed" module) nil)))
pymacs-load("ropemacs" "rope-")
setup-ropemacs()
(progn (setup-ropemacs) (autoload (quote virtualenv-activate) "virtualenv" "Activate a Virtual Environment specified by PATH" t) (autoload (quote virtualenv-workon) "virtualenv" "Activate a Virtual Environment present using virtualenvwrapper" t) (add-hook (quote python-mode-hook) (lambda nil (if (buffer-file-name) (flymake-mode)))) (defun workon-postactivate (virtualenv) (require (quote virtualenv)) (virtualenv-activate virtualenv) (desktop-change-dir virtualenv)))
(lambda nil (progn (setup-ropemacs) (autoload (quote virtualenv-activate) "virtualenv" "Activate a Virtual Environment specified by PATH" t) (autoload (quote virtualenv-workon) "virtualenv" "Activate a Virtual Environment present using virtualenvwrapper" t) (add-hook (quote python-mode-hook) (lambda nil (if (buffer-file-name) (flymake-mode)))) (defun workon-postactivate (virtualenv) (require (quote virtualenv)) (virtualenv-activate virtualenv) (desktop-change-dir virtualenv))))()
funcall((lambda nil (progn (setup-ropemacs) (autoload (quote virtualenv-activate) "virtualenv" "Activate a Virtual Environment specified by PATH" t) (autoload (quote virtualenv-workon) "virtualenv" "Activate a Virtual Environment present using virtualenvwrapper" t) (add-hook (quote python-mode-hook) (lambda nil (if (buffer-file-name) (flymake-mode)))) (defun workon-postactivate (virtualenv) (require (quote virtualenv)) (virtualenv-activate virtualenv) (desktop-change-dir virtualenv)))))
eval((funcall (quote (lambda nil (progn (setup-ropemacs) (autoload (quote virtualenv-activate) "virtualenv" "Activate a Virtual Environment specified by PATH" t) (autoload (quote virtualenv-workon) "virtualenv" "Activate a Virtual Environment present using virtualenvwrapper" t) (add-hook (quote python-mode-hook) (lambda nil (if (buffer-file-name) (flymake-mode)))) (defun workon-postactivate (virtualenv) (require (quote virtualenv)) (virtualenv-activate virtualenv) (desktop-change-dir virtualenv)))))))
eval-after-load(python (progn (setup-ropemacs) (autoload (quote virtualenv-activate) "virtualenv" "Activate a Virtual Environment specified by PATH" t) (autoload (quote virtualenv-workon) "virtualenv" "Activate a Virtual Environment present using virtualenvwrapper" t) (add-hook (quote python-mode-hook) (lambda nil (if (buffer-file-name) (flymake-mode)))) (defun workon-postactivate (virtualenv) (require (quote virtualenv)) (virtualenv-activate virtualenv) (desktop-change-dir virtualenv))))
eval-buffer(#<buffer *load*-819053> nil "c:/Users/mmsc/AppData/Roaming/.emacs.d/emacs-for-python/epy-python.el" nil t) ; Reading at buffer position 4662
load-with-code-conversion("c:/Users/mmsc/AppData/Roaming/.emacs.d/emacs-for-python/epy-python.el" "c:/Users/mmsc/AppData/Roaming/.emacs.d/emacs-for-python/epy-python.el" nil t)
require(epy-python)
eval-buffer(#<buffer *load*-283406> nil "c:/Users/mmsc/AppData/Roaming/.emacs.d/emacs-for-python/epy-init.el" nil t) ; Reading at buffer position 476
load-with-code-conversion("c:/Users/mmsc/AppData/Roaming/.emacs.d/emacs-for-python/epy-init.el" "c:/Users/mmsc/AppData/Roaming/.emacs.d/emacs-for-python/epy-init.el" nil nil)
load("c:/Users/mmsc/AppData/Roaming/.emacs.d/emacs-for-python/epy-init.el" nil nil t)
load-file("C:\\Users\\mmsc\\AppData\\Roaming\\.emacs.d\\emacs-for-python\\epy-init.el")
eval-buffer(#<buffer *load*> nil "c:/Users/mmsc/AppData/Roaming/.emacs" nil t) ; Reading at buffer position 656
load-with-code-conversion("c:/Users/mmsc/AppData/Roaming/.emacs" "c:/Users/mmsc/AppData/Roaming/.emacs" t t)
load("~/.emacs" t t)
我试图从互联网上搜索一些帮助,但大多数都是针对 Linux/Unix 环境的。有没有人在 Windows 下将 Emacs 与 Python 一起使用并且知道这是什么意思以及我该如何修复它?
谢谢!
最佳答案
评论有点过分了:
(let ((process
(apply 'start-process "pymacs" buffer
(let ((python (getenv "PYMACS_PYTHON")))
(if (or (null python) (equal python ""))
pymacs-python-command
python))
"-c" (concat "import sys;"
" from Pymacs import main;"
" main(*sys.argv[1:])")
(append
(and (>= emacs-major-version 24) '("-f"))
(mapcar 'expand-file-name pymacs-load-path)))))
这是在 *Pymacs*
缓冲区中启动进程的 Pymacs 代码位。您可以由此推断 Pymacs 将首先搜索环境变量 $PYMACS_PYTHON
,如果不存在或者它的值为空字符串,那么它将尝试 pymacs-python-command
,默认情况下是 "python"
。因此,它将进行以下调用:
$ python -c 'import sys; from Pymacs import main; main(*sys.argv[1:])'
-f
有问题 - 我不知道哪个版本的 Python 接受这个参数,但我有一个不接受。这段代码的意图很明确——可能它必须加载 pymacs-load-path
上的文件,但对我来说这个变量的值是 nil
- 所以我不要认为这段代码曾经运行过。无论如何,这个论点似乎并没有伤害我,无论有没有它都一样。
因此,如果您尝试在控制台中运行上述命令,并得到如下信息:
(version "0.25")
然后这段代码可以正常工作,否则,您会得到一些错误,这将帮助您找出问题所在。请记住,它可能不仅仅是 python
。它是 $PYMACS_PYHON
或 pymacs-python-command
。
关于python - Windows 8 + Emacs 24.3 + emacs-for-python : Pymacs helper did not start within 30 seconds,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16973236/
我通过“emacs --daemon”启动了 emacs 服务器。然后我开了几个客户端。 我想将 .emacs 配置的更改应用于所有客户端,而无需重新启动 emacs 守护程序。这可能吗? 最佳答案
我通过“emacs --daemon”启动了 emacs 服务器。然后我开了几个客户端。 我想将 .emacs 配置的更改应用于所有客户端,而无需重新启动 emacs 守护程序。这可能吗? 最佳答案
我看到了一些关于使 emacs 便携(在 Windows 上)的建议。我的 site-start.el 中有这个: (defvar program-dir (substring data-direct
我是一名狂热的 Vim 用户。我的 Vimrc 有 800 多行。我是一个喜欢定制环境的每个部分的修补匠。 Emacs 似乎更容易配置。所以我尝试一下 Emacs。 当您想要缩小时,请按 Emacs
我是一名狂热的 Vim 用户。我的 Vimrc 有 800 多行。我是一个喜欢定制环境的每个部分的修补匠。 Emacs 似乎更容易配置。所以我尝试一下 Emacs。 当您想要缩小时,请按 Emacs
偶尔在term中使用emacs时模式我会误运行emacs file而不仅仅是打开文件。这将在当前客户端内创建一个嵌套的 emacs 客户端。我的问题是如何只关闭内部客户端? 最佳答案 回答 您应该可以
我一直在慢慢学习 elisp 和 emacs 的新命令,并且一直在稳步构建我的 .emacs。必须保持控制台打开以重复打开和关闭 emacs 实例似乎不是测试的最佳选择,但是从 emacs 中运行 e
我正在寻找一个 emacs 服务器,以便 emacsclients 指定的文件 是相对于 emacsclients 的文件系统而不是服务器的文件系统。例如,如果我设置一个 机器“darkstar”上的
我试图将我所有的 emacs 配置置于版本控制之下,以便在不同的计算机之间轻松切换。实际上我的首选系统是 OSX (10.8.3) 和来自 http://emacsformacosx.com/ 的 e
我正在学习 emacs,我认为使用 emacs 的内置帮助功能开发设施将真正平滑学习击键的学习曲线。 使用 emacs 的内置帮助功能来查找命令名称及其击键的有效过程是什么? 例如,我忘记了关闭框架的
我一直在尝试将 emacs minibuffer 的字体/字体与 emacs 默认字体分开,但没有太多运气。 具体来说,我有兴趣使 minibuffer 字体大小更大以用于 emacs MULE,因为
大约 4 年以来,我一直是一个相当普通的 emacs 用户,但在自定义 emacs 和排除 elisp 故障时,我仍然是新手。最近,我开始自定义 emacs 作为我的 ruby 开发环境,并且我从
我希望 emacs 能够处理一些耗时的任务,而不阻塞输入。为此,我尝试了(其中插入的意思是用耗时的任务来代替) (call-process "emacs" nil 0 nil "--eval=(ins
我的 init.el 中有这个设置 (desktop-save-mode 1) 这很好用,只是我想知道: 如何更改它以将 .emacs.desktop 文件保存到 ~/.emacs.d 而不是 ~/
我是 Emacs 包的作者,偶尔在处理我的包时,我会遇到一个看起来很有用的函数并在我的代码中使用它。然后,在我发布后不久,有人使用旧的 Emacs 版本(但仍然是我想要支持的版本)会报告该功能未定
我用 (message "..some text...") 在我的 init 文件中,在 EMACS 加载时将消息发送到消息缓冲区。这是我查看我刚刚所做的更改导致启动崩溃的快速方法。 但是,我无法找到
简单的问题,我在 Emacs 中使用通用模式进行颜色编码。除了在这种语言中 " 和 ' 可以用来表示字符串之外,下面的代码很好用,如 'this is a string' 或 “这是一个字符串”。默认
有没有办法让我的 Emacs 以预定义的框架作为我附加的屏幕截图开始?我不太熟悉如何在我的 .emacs 脚本中执行此操作... 就这么简单: split-window-horizontally(
在emacs markdown-mode写markdown时,我想让electric-pair-mode自动关闭**bold**和 *italic*成对语法,即当输入一个 * 一秒时 * 应该自动出现
Emacs 是否有一个简单的原始缩进模式可以执行以下操作: 当我转到新行(按 Enter)时,复制上述行 用于缩进的任何空格 当我按 Tab 时,在我按 Tab 的地方插入可以配置的缩进字符(空格/制
我是一名优秀的程序员,十分优秀!