【发布时间】:2014-08-17 13:05:05
【问题描述】:
我是新手 emacs 用户,目前我正在尝试为 python 设置工作环境。我正在使用rope,但遇到了以下问题:虽然rope的“查找事件”命令工作正常,但它的结果被放在一个无模式的缓冲区中,要访问它们我必须复制文件名。
缓冲区内容为here
据我所知,编译模式提供了关闭功能到我想要的功能(即,在单击或按 RET 后在给定行上打开文件)。然而,事实上,启用编译模式只会导致文件名突出显示。
如果我没有正确理解,要处理行,我需要将项目提供到 compiler-error-regexp-alist 中,就像在以下 sn-p 中所做的那样(来自 emacs wiki
(require 'compile)
(let ((symbol 'compilation-ledger)
(pattern '("^Error: \"\\([^\"\n]+?\\)\", line \\([0-9]+\\):" 1 2)))
(cond ((eval-when-compile (boundp 'compilation-error-regexp-systems-list))
;; xemacs21
(add-to-list 'compilation-error-regexp-alist-alist
(list symbol pattern))
(compilation-build-compilation-error-regexp-alist))
((eval-when-compile (boundp 'compilation-error-regexp-alist-alist))
;; emacs22 up
(add-to-list 'compilation-error-regexp-alist symbol)
(add-to-list 'compilation-error-regexp-alist-alist
(cons symbol pattern)))
(t
;; emacs21
(add-to-list 'compilation-error-regexp-alist pattern))))
我应该如何修改它以使其与我的缓冲区一起使用?
有更好/更快的选择吗?
【问题讨论】:
-
find-file-at-point可能会给你你想要的功能。我不使用 python,但你确定rope将东西放在无模式缓冲区中吗?转到该缓冲区并使用M-: major-mode检查 - 一旦你得到了,你可以在该模式下将密钥绑定到find-file-at-point。