tags:

views:

1020

answers:

3

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

+1  A: 

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.

Ryan Neufeld
+7  A: 

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.

Deniz Dogan
+1  A: 

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

polyglot