How do you get ediff + hg working in emacs 23.2 for mac?

≯℡__Kan透↙ 提交于 2019-12-12 21:23:56

问题


Im using the emacs binary from http://emacsformacosx.com/ When I'm editing a file in a mercurial source directory and run "ediff-revision" I get:

"File /the/file/im/editing.py is not under version control"

This command works on the vanilla windows distribution and also with aquamacs, is there something I need to do for vanilla GNU Emacs for mac to work correctly?

I've tried it with only this in my .emacs

(require 'ediff)

回答1:


So Mercurial for OSX installs itself in /usr/local/bin It seems emacs knows to look there in the Aquamacs and the command line versions. To get it working for GNU emacs I made a symbolic link of /usr/local/bin/hg in /usr/bin After that, every thing started working just fine.

# Open Terminal
cd /usr/bin
sudo ln -s /usr/local/bin/hg hg

Another method I ran across was to set the variable vc-path, however I couldn't get that solution to work. Thanks for those that took a stab at this.




回答2:


I had to do 2 things to get it working right for me.

First, make sure Emacs' vc system can see hg:

(add-to-list 'exec-path "/usr/local/bin")

And second, make sure that hg can be found from the shell:

(setenv "PATH" (concat (getenv "PATH") ":/usr/local/bin"))




回答3:


I faced the similar situation and tell you my story.

Typing C-x v = (vc-diff) on a buffer I have been working on I got:

File is not under version control

What? Then I came here, checked every comment posted above, and found nothing irregular.

Hmm... What is wrong? The status bar shows like this:

U:--- xxx.py     84% (500, 38)    (Py Outl)

I tried to open another file in the same directory by typing C-x d RET (dired), then g to update the buffer, C-n to move to another file, e to open it. Well, this time the status bar shows like this:

-:--- yyy.py     All (1, 0)     Hg-0    (Py Outl)

Now I got a point! Firstly, I had started editing the first file with Aquamacs (emacs variant for Mac OS). Secondly, I did hg init, hg ci -m 'Imported the first version' .

Okay, C-x k (kill-buffer) to close xxx.py and then open it again. Bingo! Now the status bar shows like this:

-:--- xxx.py     Bot (500, 0)    Hg:0   (Py Outl)

Everything works fine now. You have a nice day!



来源:https://stackoverflow.com/questions/5177304/how-do-you-get-ediff-hg-working-in-emacs-23-2-for-mac

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!