The Emacs platform is very powerful and is not just as simple as an editor. It is transplanted to the Windows platform so that non-Unix users can access and use it.
Previously, I wrote a description of Emacs in Windows 7, which briefly describes how to install Emacs in windows. However, it is not the best method.
This is because the home directory c: \ Users \ <username> \ appdata \ roaming is too deep when configured according to the Home Directory of Windows 7 system, in addition, the appdata directory is hidden by default. The most important thing is: if the system disk has a problem. emacs configuration file and. el extensions must be reconfigured and downloaded.
There are two other ways to change the Home Directory: one is to add the home system environment variables, which has a major drawback. If the system also has installed Java SDK, cygwin, and so on, then we can imagine that these software "cannot find the North"; the second is to add
HKEY_LOCAL_MACHINE \ SOFTWARE \ GNU \ Emacs \ home = % emacs_dir % registry key. Hello, You have to restart the system...
This article introduces the best method that one person thinks:
First of all, let's take a look at the simple installation of Emacs, http://ftp.gnu.org/pub/gnu/emacs/windows/emacs-23.2-bin-i386.zip here to download the latest emacs-23.2, and extract to a disk root directory, I put it in the D: \, unzip, get D: \ emacs-23.2, enter the D: \ emacs-23.2 \ bin directory, execute
Addpm.exe adds the Emacs startup item to the Start Menu.
Start Emacs and change the settings in the option menu. For example, cancel case-insensitive search and click Save options. This step is not redundant, because by default, emacs will not generate the. emacs configuration file and. emacs. d directory at startup. The. emacs directory generated in this step is still under c: \ Users \ <username> \ appdata \ roaming, because we have not made any other settings to move it ~
Next, go to the key step. Open the c: \ Users \ <username> \ appdata \ roaming \. emacs configuration file and change the content
- (Load-file "D: // emacs-23.2/. emacs ")
Copy code
This configuration means that the Emacs will load c: \ Users \ <username> \ appdata \ roaming \ at startup \. emacs configuration file, which loads another D:/emacs-23.2 /. emacs configuration file. In this way, the configuration transfer is achieved ~ Now, you do not need to enter the redundant path c: \ Users \ <username> \ appdata \ roaming \. emacs!
In the previous step, we used the Emacs configuration file (load-file ...) the configuration has been directed to D:/emacs-23.2 /. if Emacs is finished, copy one of the two. put the emacs file in D:/emacs-23.2. ). Open D:/emacs-23.2/. emacs and add the following configuration at the beginning:
- (Setenv "home" "D:/emacs-23.2 ")
- (Setenv "path" "D:/emacs-23.2 ")
- ; Set the default file path
- (Setq default-directory "~ /")
Copy code
Well, yes. Here we have defined a new path for home path and so on ~~~ You should understand it here, that is, transfer the configuration.
Now you can take D:/emacs-23.2 as the home of Emacs, configuration can refer to this post: http://club.topsage.com/thread-2252500-1-1.html, the two simple extensions in, by specifying the load-path ~ /. Emacs. d/elisp
- (Setq load-path (Cons "~ /. Emacs. d/elisp "load-path ))
Copy code
That is D:/emacs-23.2/. emacs. d/elisp, put the two files into the OK ~!
<End>