如何在Mac OS X上获取可可emacs以便为新窗口(在第一个窗口之后打开的任何文档)加载.emacs可视化自定义设置? [英] How do I get my cocoa emacs on Mac OS X to load my .emacs visual customizations for new windows (any document opened after the first)?

查看:155
本文介绍了如何在Mac OS X上获取可可emacs以便为新窗口(在第一个窗口之后打开的任何文档)加载.emacs可视化自定义设置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我刚从 http://emacsformacosx.com/下载了我的新雪豹Macbook pro的emacs 23.1.它的工作原理就像一种魅力,除了...

So I just downloaded emacs 23.1 for my new snow leopard macbook pro from http://emacsformacosx.com/ and it works like a charm, except...

.emacs中有可视化自定义项,此处提取了几行:

I have visual customizations in my .emacs, a few lines are extracted here:

(设置背景颜色黑色")
(设置光标颜色为绿色") (设置默认字体- -Lucida Console-normal-r-normal-normal-18- -96-96-c-*-iso10646-1")

(set-background-color "black")
(set-cursor-color "green") (set-default-font "--Lucida Console-normal-r-normal-normal-18--96-96-c-*-iso10646-1")

我还设置了一些键绑定,这是其中的几行

I also have some key bindings set up, here are a few lines of those

(全局设置键"\ C-l"`转到行)

(global-set-key "\C-l" `goto-line)

(全局设置键[(控制权%)]`query-replace-regexp)

(global-set-key [(control ?%)] `query-replace-regexp)

我第一次启动emacs或使用emacs打开文档时,所有内容都能完美加载.当我发出Command-N或通过finder打开另一个文件时,会打开一个新窗口,其中加载了按键绑定自定义项,但没有视觉自定义项(包括窗口大小等)

The first time I start emacs or open a document with emacs, everything loads perfectly. When I issue a command-N or open another file through finder, a new window opens with the key binding customizations loaded but without the visual customizations (including window size, etc)

我认为这与emacsclient的调用方式和emacs服务器有关,但是尽管我狂热地使用emacs进行开发,但是在.emacs级别之外设置编辑器本身时我一无所知.定制

I think this has something to do with how emacsclient is being invoked and the emacs server, but despite my avid usage of emacs for development, I'm pretty clueless when it comes to setting up the editor itself outside of .emacs level customization

按偏好顺序,当我打开一个新窗口(通过command -n或在finder中打开文档)时,我想实现以下潜在行为:

Here are potential behaviors I would like to achieve when a new window is opened (via command-n or opening a document in finder), in order of preference:

  1. 在新窗口中创建一个新的emacs进程(而不仅仅是一个新的缓冲区),以便我可以管理和导航多个项目,类似于textmate的工作方式,每个项目都使用一个emacs进程.

  1. Have the new window create a new emacs process (not just a new buffer) so that I can manage and navigate multiple projects similar to how textmate does it, using one emacs process for each project.

使这些可视化自定义项具有持久性,以便每个新窗口加载正确的大小,字体和颜色.

Have those visual customizations be persistent so that each new window loads with the correct sizing, fonts, and colors.

在当前活动的emacs窗口中打开每个新文档作为缓冲区.

Have each new document open as a buffer within the current active emacs window.

让我知道你们是否可以提供帮助,谢谢!

Let me know if you guys can help, thanks!

推荐答案

好,我想出了从终端执行此操作(为每个新项目启动一个新的emacs服务器)的方法,我敢肯定这样做很简单.它也可以在取景器中工作,但是因为无论如何我通常都在航站楼,所以它对我有用.我刚刚将其添加到我的~/.profile

OK I figured out how to do this (start a new emacs server for each new project) from the terminal, I'm sure it would be trivial to get it working from the finder too but since I'm usually in terminal anyway it works for me. I just added this to my ~/.profile

function emacs-open() {
    /Applications/Emacs.app/Contents/MacOS/Emacs $1 &
}

然后,当您想在新项目(emacs服务器)中打开所有ur框架自定义项并正确加载.emacs的文件时,它只是

then when you want to open a file in a new project (emacs server) with all ur frame customizations and .emacs loaded correctly, it's just

$ emacs-open index.php

$ emacs-open index.php

我知道这对某些人来说似乎确实很明显,但是据我所知,当您从

I know this may seem really obvious to some, but as far as i could tell it's not done for you anywhere when u dl the package from http://emacsformacosx.com/ so hopefully this helps somebody

这篇关于如何在Mac OS X上获取可可emacs以便为新窗口(在第一个窗口之后打开的任何文档)加载.emacs可视化自定义设置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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