Emacs:将 psvn.el 文件放在哪里?

发布于 2024-07-25 08:28:02 字数 1213 浏览 6 评论 0原文

我对 emacs 完全陌生,并且开始学习如何有效地使用它。

我首先想使用的是 svn 模式。

我下载了 psvn.el 并将其放入 ~/.emacs.d 目录

然后按照 psvn.el 文件注释部分中的说明,我将这一行放入

(require 'psvn)

.emacs 文件

这是我当前的 .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))
(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.
 )

(require 'psvn)

现在当我启动 emacs,收到此错误消息:

An error has occurred while loading `/home/akong/.emacs':

File error: "Cannot open load file", "psvn"

To ensure normal operation, you should investigate the cause
of the error in your initialization file and remove it.  Start
Emacs with the `--debug-init' option to view a complete error
backtrace

我是否将 psvn.el 放在错误的位置?

我使用的是cygwin + WinXP

I am totally new to emacs and is starting to learn how to use it effectively.

The first thing I wanna use is the svn mode.

I downloaded psvn.el and put it in the ~/.emacs.d directory

Then following the instruction in the comment part of the psvn.el file, I put this line

(require 'psvn)

Into the .emacs file

This is my current .emacs file

(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))
(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.
 )

(require 'psvn)

Now when I starts emacs, I got this error message:

An error has occurred while loading `/home/akong/.emacs':

File error: "Cannot open load file", "psvn"

To ensure normal operation, you should investigate the cause
of the error in your initialization file and remove it.  Start
Emacs with the `--debug-init' option to view a complete error
backtrace

Did I put the psvn.el in a wrong location?

I am using cygwin + WinXP

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

橘虞初梦 2024-08-01 08:28:02

这是因为 Emacs 在其 load-path 上找不到任何提供 psvn 的文件。

在你的 shell 中:

mkdir -p ~/.emacs.d                # Make the directory unless it exists
mv /some/path/psvn.el ~/.emacs.d/  # Move psvn.el into that directory

在你的 Emacs 初始化文件中(通常是 ~/.emacs):

(add-to-list 'load-path "~/.emacs.d")  ; Add this directory to Emacs' load path
(require 'psvn)                        ; Load psvn

编辑:我刚刚意识到你使用的是 Windows XP。 我不确定 Cygwin 将如何处理所有这些,但在 Cygwin 之外的过程几乎相同,只需记住 ~ 在 Windows XP 上是 %APPDATA% ,因此 .emacs.d.emacs 都应该位于该目录中。

This is because Emacs cannot find any file providing psvn on its load-path.

In your shell:

mkdir -p ~/.emacs.d                # Make the directory unless it exists
mv /some/path/psvn.el ~/.emacs.d/  # Move psvn.el into that directory

In your Emacs init file (often ~/.emacs):

(add-to-list 'load-path "~/.emacs.d")  ; Add this directory to Emacs' load path
(require 'psvn)                        ; Load psvn

EDIT: I just realized that you are on Windows XP. I'm not sure how Cygwin will handle all of this, but the procedure is pretty much the same outside of Cygwin, just remember that ~ is %APPDATA% on Windows XP, so .emacs.d and .emacs should both be in that directory.

街道布景 2024-08-01 08:28:02

我猜您在 Windows 上查找主目录时遇到问题? 尝试 Cx d ~ RETURN (在你的主目录上运行 dired)来查看你的主目录在哪里,然后按照其他答案所说的操作:将 psvn.el 放入 .emacs.d 并在你的加载中添加 ~/.emacs.d -小路

I guess you have problem finding your home directory on Windows? Try C-x d ~ RETURN (run dired on your home directory) to see where you home directory is, then do what the other answers say: put psvn.el in .emacs.d and add ~/.emacs.d in your load-path

靖瑶 2024-08-01 08:28:02

您要做的第一件事是将 .emacs.d 添加到您的加载路径中,以便它知道在哪里查找。 一般来说,大多数人将 .el 插件存储在 ~/.emacs.d/site-lisp 中,所以我这样做:

;; >>> Configure Load Path <<< ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(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)))

;; I should really just do this recursively.
(add-path "") 
;; (add-path "some-nested-folder")

现在 (require 'psvn)应该效果很好。

First thing you're going to want to do is add .emacs.d to your load path so it knows where to look. Generally most people store .el plugins in ~/.emacs.d/site-lisp so i do this:

;; >>> Configure Load Path <<< ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(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)))

;; I should really just do this recursively.
(add-path "") 
;; (add-path "some-nested-folder")

Now (require 'psvn) should work out fine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文