简体   繁体   English

Emacs Magit commit打开新的Emacs客户端

[英]Emacs Magit commit opens new Emacs client

I've been using Magit for awhile, and when committing, it used to simply split the window and allow me to commit from within the same emacs session, but I seem to have changed this behavior to the following: 我使用Magit已有一段时间了,提交时,它只是用来拆分窗口,并允许我在同一emacs会话中提交,但是我似乎已将此行为更改为以下内容:

Now, when I commit my staged changes, a new emacs client starts up, taking awhile to load, finally letting me write my commit message. 现在,当我提交我的阶段更改时,将启动一个新的emacs客户端,需要花费一些时间来加载,最后让我编写我的提交消息。 I then run Cc Cc to commit. 然后,我运行Cc Cc提交。 The commit goes through when I close this client. 当我关闭此客户端时,提交将通过。

How do I force magit to run the commit within the same session of emacs and NOT open a whole new client? 如何强制magit在同一emacs会话中运行提交,而不打开整个新客户端?

在此处输入图片说明

This bug is noted (but not solved) as a github issue here: https://github.com/magit/magit/issues/862 此错误在此处作为github问题记录(但未解决): https : //github.com/magit/magit/issues/862

I think the issue here is that magit is calling 'emacsclient', which by default is /usr/bin/emacsclient. 我认为这里的问题是magit调用了'emacsclient',默认情况下是/ usr / bin / emacsclient。 It needs to call the emacsclient that is packaged with emacs in order to work properly - other emacsclients (from homebrew, macports, etc) won't know how to connect. 它需要调用与emacs打包在一起的emacsclient才能正常工作-其他emacsclients(来自自制软件,macports等)将不知道如何连接。 Normally most of us take care of this with an alias or environment variable in our shell startup scripts. 通常,我们大多数人都在shell启动脚本中使用别名或环境变量来解决此问题。 However, when you run emacs.app outside of a shell it won't see these. 但是,当您在外壳程序外部运行emacs.app时,将不会看到这些内容。 I was able to get git-commit-mode to work properly by adding this to my init.el: 通过将其添加到init.el中,我能够使git-commit-mode正常工作:

(set-variable 'magit-emacsclient-executable "/Applications/Emacs.app/Contents/MacOS/bin/emacsclient")

I'm using an EmacsForMacOSX build, 24.3. 我正在使用EmacsForMacOSX版本24.3。 This worked for me, hopefully it fixes it for you as well. 这对我有用,希望它也可以为您解决。

We have recently made some major changes to magit . 我们最近对magit进行了一些重大更改。 The commit mode has greatly changed and has created a lot of quirks. 提交模式已经发生了很大的变化,并产生了许多怪癖。 The problems currently investigated, as well as the current known fixes are listed in the Known Issues of the repository. 存储库的“ 已知问题 ”中列出了当前调查的问题以及当前已知的修复程序。 Your issue is one of them. 您的问题就是其中之一。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM