如何在 Lisp In A Box 中更改 emacs 配置
我成为一名程序员已有十年了,但我相信这是我第一次在论坛上提出问题。我只是无法弄清楚这一点,也无法在网上找到答案。
我正在尝试打开 CUA 模式,以便 emacs 对于 Windows 用户来说更容易忍受(正常的复制粘贴功能)。我运行的是 Windows 7 并通过 Lisp In A Box 包安装了 emacs。我知道我需要在 .emacs 文件或 init.el 文件中添加一行。我不确定是哪一个,但在我的 Lip In A Box 安装目录中都找不到。 emacs 软件包安装也没有附带任何教程或帮助文件,因此很难掌握它。
我被困住了,非常感谢任何帮助!
I have been a programmer for a decade now, but I believe this is the first time I've ever asked a question on a forum. I just can't figure this out and can't find the answer already online.
I am trying to turn on CUA mode so that emacs is more bearable for a windows user (normal copy paste functions). I am running Windows 7 and installed emacs through the Lisp In A Box package. I understand that I need to add a line to my .emacs file or init.el file. I'm not sure which, but I can't find either in my Lip In A Box install directory. The emacs package install also did not come with any tutorials or help files, so its really hard to pick this up.
I am stuck, any help is greatly appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
.emacs 可以通过查看 类似的答案来找到问题。
关于文档和教程,您为“Lisp in a Box”提供的链接看起来像:
这听起来像是手册就在那里,当然还有教程(我用粗体显示了进入教程的指示)。
至于获取信息的其他地方,有一个 wiki 上的截屏视频集合。
您的问题没有指定您是否要添加到 .emacs 中以激活 CUA 模式。您可以查看 wiki 上的 CUA 模式文档(其中包含指向手册的链接)。最小安装只需将其添加到您的 .emacs 中:
(cua-mode t)
。The .emacs can be found by looking at the answers to this similar question.
Regarding documentation and tutorials, it looks like the link you provided for "Lisp in a Box" says:
Which makes it sound like the manual is there, and certainly the tutorial (I made bold the directions to get to the tutorial).
As far as other places to get information, there is a collection of screencasts on the wiki.
Your question doesn't specify whether or not you what to add to your .emacs to activate CUA mode. You can check out the CUA mode documentation on the wiki (which has links to the manual). The minimal installation is just adding this to your .emacs:
(cua-mode t)
.对于 GNU/Emacs,您可以选择使用以下三个文件名中的任何一个作为启动配置文件:
决定三个选项之一然后坚持使用第一个可能是个好主意似乎是使用最广泛的一种。无论如何,${HOME} 代表您的主目录——这可能与 Lisp In A Box 安装目录不同!
源自 Unix 传统,Emacs 将 ~(波形符)理解为主目录的缩写,因此您可以通过键入以下内容来访问 .emacs 文件:(
请注意,大写 C 是 CTRL 键和 a 组合的 Emacs 标准表示法)第二个键,即在这里按 CTRL-x CTRL-f,它代表“查找文件”,然后会要求您在框架底部(也称为迷你缓冲区)提供文件名。)
如果这些是您的第一个自定义后,您只会看到一个空缓冲区。 使用 Cx Cs输入
并保存缓冲区。
下次启动 Emacs 时,CUA 模式应该会自动打开。
For GNU/Emacs, you can choose to use any one of the following three file names as the start-up configuration file:
It would probably be a good idea to decide on one of the three options and then stick to it - the first one seems to be the most widely used one. In any case, ${HOME} stands for your home directory -- which is likely to be different from the Lisp In A Box install directory!
Coming from a Unix tradition, Emacs understands ~ (tilde) as an abbreviation for your home directory, so you can visit the .emacs file by typing:
(Note that the capital C is Emacs standard notation for a combination of the CTRL key and a second key, i.e. here you press CTRL-x CTRL-f which stands for "find-file" and will then ask you for a file name in the bottom part of the Frame (aka mini-buffer).)
If these are your first customizations, you will just see an empty buffer. Enter
and save the buffer with C-x C-s.
Next time you start Emacs, CUA mode should be turned on automatically.
其他人告诉你的是真的:只需将 (cua-mode t) 添加到你的点文件中就足够了。然而:Lisp in a box 的 Emacs 默认情况下不会加载此文件。
因此,请务必编辑快捷方式,以便它加载点文件。这很重要,因为否则您会得到奇怪的行为,您会将正确的行添加到点文件中,启动 emacs,然后无法进入 cua 模式。那会很糟糕。
它这样做的原因是为了确保每次都启动一个普通的 emacs,而不是查找 C:/_emacs 并加载它,从而为您提供另一个用户的自定义设置并使您感到困惑。
不加载初始化文件的标志是 -q 或 --no-init-file。还要确保 --no-site-file 不存在。
(我意识到这是一篇旧帖子,但我在寻找相关内容时发现了这一点,我不希望人们因为一些不起作用的东西而感到沮丧。)
What the others have told you is true: Simply adding (cua-mode t) to your dotfile would be sufficient. HOWEVER: Lisp in a box' Emacs doesn't load this file by default.
Therefore, be sure to edit the shortcut so that it does load the dotfile. This is important, because otherwise you would get weird behavior, where you would add the correct line to the dotfile, start emacs, and then not get cua mode. That would suck.
The reason it does this is to ensure that it starts a vanilla emacs everytime, instead of finding, say C:/_emacs and loading that instead, giving you another user's customizations and confusing you.
The flag for not loading an init file is -q or --no-init-file. Also make sure that --no-site-file is not there.
(I realize that this is an old post, but I found this while looking for something related, and I don't want people walking away frustrated over something that doesn't work.)