我正在尝试为python开发设置emacs。
据我所读,建议使用python-mode.el而不是Emacs22.3中的默认python.el。所以我开始了新的冒险。
据我所知,python模式有几个依赖项,所以我需要安装绳索、ropemode和ropemacs。除此之外,我还需要安装pymacs。
问:对吗?
这是我的新.emacs:
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(inhibit-startup-screen t)
'(tab-width 4))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
(setq emacs-config-path "~/.emacs.d/")
(setq base-lisp-path "~/.emacs.d/site-lisp/")
(setq site-lisp-path (concat emacs-config-path "/site-lisp"))
(defun add-path (p)
(add-to-list 'load-path (concat base-lisp-path p)))
(add-path "")
(add-to-list 'load-path "~/.emacs.d")
(require 'psvn)
;; python-mode
;;
(setq auto-mode-alist (cons '("\\.py$" . python-mode) auto-mode-alist))
(setq interpreter-mode-alist (cons '("python" . python-mode) interpreter-mode-alist))
(autoload 'python-mode "python-mode" "Python editing mode." t)
(setq pymacs-load-path '( "~/.emacs.d/site-lisp/rope"
"~/.emacs.d/site-lisp/ropemode"
"~/.emacs.d/site-lisp/ropemacs"))
(setq interpreter-mode-alist
(cons '("python" . python-mode)
interpreter-mode-alist)
python-mode-hook
'(lambda () (progn
(set-variable 'py-indent-offset 4)
(set-variable 'py-smart-indentation nil)
(set-variable 'indent-tabs-mode nil)
;;(highlight-beyond-fill-column)
(define-key python-mode-map "\C-m" 'newline-and-indent)
(pabbrev-mode)
(abbrev-mode)
)
)
)
;; pymacs
(autoload 'pymacs-apply "pymacs")
(autoload 'pymacs-call "pymacs")
(autoload 'pymacs-eval "pymacs" nil t)
(autoload 'pymacs-exec "pymacs" nil t)
(autoload 'pymacs-load "pymacs" nil t)
;; Search local path for emacs rope
;;
;; enable pymacs
;;
(require 'pymacs)
(pymacs-load "ropemacs" "rope-")现在,当我启动emacs时,我收到了以下错误消息:
("C:\\opt\\emacs-22.3\\bin\\emacs.exe")
Loading encoded-kb...done
Loading regexp-opt...done
Loading easy-mmode...done
Loading wid-edit...done
Loading edmacro...done
Loading derived...done
Loading advice...done
Loading cl-macs...done
Loading byte-opt...done
An error has occurred while loading `c:/opt/cygwin/home/akong/.emacs':
File error: Cannot open load file, pymacs
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.
For information about GNU Emacs and the GNU system, type C-h C-a. [2 times]使它变得更加复杂:
由于工作原因,我不得不使用python2.4,但我的PC上安装了python2.6。但显然绳子不喜欢2.4,所以我没有运行setup.py。我解压缩这些包,并将这些文件放在~/.emacs.d/site-lisp下。默认情况下,如果在命令提示符中调用python,它就是python2.4可执行文件。
问:我如何成功地加载'pymacs'?
发布于 2009-07-06 03:38:31
原来我错过了这两个:
(add-to-list 'load-path "~/.emacs.d/site-lisp/Pymacs-0.23")显然,我需要加载pymac脚本。
由于工作原因,我将env PYMACS_PYTHON设置为python2.6,因为我使用python2.4作为默认python解释器。
发布于 2009-07-03 07:28:47
到目前为止,我从未使用过pymacs,但是当我查看您的.emacs时,吸引我注意的一点是,您显然没有将pymacs目录添加到emacs load-path中,而只添加到pymacs目录中:
(setq pymacs-load-path '( "~/.emacs.d/site-lisp/rope"
"~/.emacs.d/site-lisp/ropemode"
"~/.emacs.d/site-lisp/ropemacs"))您可能还需要这样的东西:
(add-to-list 'load-path "~/.emacs.d/site-lisp/rope")
(add-to-list 'load-path "~/.emacs.d/site-lisp/ropemode")
(add-to-list 'load-path "~/.emacs.d/site-lisp/ropemacs")(或者任何有pymacs.el的地方)这样emacs就可以找到lisp文件。在pymacs文档中也提到过
2.4安装Pymacs本身..。对Emacs来说..。 现在这通常是用手做的。首先,沿着您的Emacs加载路径中的列表选择一些目录,您可以对其进行写访问,并在该目录中复制文件pymacs.el。
发布于 2010-08-07 11:20:37
如果路径丢失,那么在启动日志中或在emacs启动时获得回溯跟踪就很容易发现这一点。如果有疑问的话,是可行的。
我也得到了公司-ropemacs拒绝加载emacs 23和emacs 24后,最新的Debian测试更新,这意味着你不能保存文件,因为绳子保存挂钩。我很想听听任何人的意见。公司我打算稍后再调试它,然后更新这个线程。
https://stackoverflow.com/questions/1078069
复制相似问题