在哪里可以找到我的.emacs文件在Windows上运行的Emacs? [英] Where can I find my .emacs file for Emacs running on Windows?

查看:137
本文介绍了在哪里可以找到我的.emacs文件在Windows上运行的Emacs?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试寻找.emacs文件为我的Windows安装Emacs,但我找不到它。它在Windows下与Unix中的文件名相同吗?



我必须自己创建吗?

解决方案

从Emacs FAQ复制并粘贴 http://www.gnu.org/software/emacs/windows/



我在哪里放置我的init文件?



在Windows上, .emacs 文件可能被称为 _emacs ,以便与DOS和FAT文件系统向后兼容,其中文件名不能以点开头。有些用户喜欢继续使用这样的名称,因为Windows资源管理器无法创建名称以点开头的文件,尽管文件系统和大多数其他程序都可以处理它。在Emacs 22及更高版本中,init文件也可能被称为 .emacs.d / init.el 。 Lisp包创建的许多其他文件现在也存储在 .emacs.d 目录中,所以这样将所有的Emacs相关文件保存在一个地方。 p>

上面提到的所有文件都应该放在你的HOME目录下。 HOME目录通过以下步骤确定:


  1. 如果设置了环境变量HOME,请使用它指示的目录。 >
  2. 如果注册表项HKCU\SOFTWARE\GNU\Emacs\HOME被设置,请使用它指示的目录。

  3. 如果注册表项HKLM \SOFTWARE\GNU\Emacs\HOME被设置,使用它指示的目录。不建议,因为它会导致用户共享相同的HOME目录。

  4. 如果 C:\.emacs 存在,则使用 C:/ 。这是为了向后兼容,因为以前的版本默认为 C:/ 如果没有设置HOME。

  5. 使用用户的AppData目录,通常是用户配置文件目录下的名为Application Data的目录,其位置根据Windows版本而异,计算机是否属于域。


$ b $在Emacs中,文件名开头的扩展到HOME目录,所以您可以随时使用 Cx Cf〜/ .emacs 。



有更多信息,请访问 MS-Windows上的HOME和启动目录


I tried looking for the .emacs file for my Windows installation for Emacs, but I could not find it. Does it have the same filename under Windows as in Unix?

Do I have to create it myself? If so, under what specific directory does it go?

解决方案

Copy and pasted from the Emacs FAQ, http://www.gnu.org/software/emacs/windows/:

Where do I put my init file?

On Windows, the .emacs file may be called _emacs for backward compatibility with DOS and FAT filesystems where filenames could not start with a dot. Some users prefer to continue using such a name, because Windows Explorer cannot create a file with a name starting with a dot, even though the filesystem and most other programs can handle it. In Emacs 22 and later, the init file may also be called .emacs.d/init.el. Many of the other files that are created by Lisp packages are now stored in the .emacs.d directory too, so this keeps all your Emacs related files in one place.

All the files mentioned above should go in your HOME directory. The HOME directory is determined by following the steps below:

  1. If the environment variable HOME is set, use the directory it indicates.
  2. If the registry entry HKCU\SOFTWARE\GNU\Emacs\HOME is set, use the directory it indicates.
  3. If the registry entry HKLM\SOFTWARE\GNU\Emacs\HOME is set, use the directory it indicates. Not recommended, as it results in users sharing the same HOME directory.
  4. If C:\.emacs exists, then use C:/. This is for backward compatibility, as previous versions defaulted to C:/ if HOME was not set.
  5. Use the user's AppData directory, usually a directory called Application Data under the user's profile directory, the location of which varies according to Windows version and whether the computer is part of a domain.

Within Emacs, ~ at the beginning of a file name is expanded to your HOME directory, so you can always find your .emacs file with C-x C-f ~/.emacs.

There's further information at HOME and Startup Directories on MS-Windows.

这篇关于在哪里可以找到我的.emacs文件在Windows上运行的Emacs?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆