开发者

How to check if a file is in Git repository when visiting from emacs?

开发者 https://www.devze.com 2022-12-10 03:08 出处:网络
I would be most happy with some kind of emacs hook that would be activated when a file that is under git reposi开发者_如何学Pythontory is visited. But other solutions are welcome as well.You can try g

I would be most happy with some kind of emacs hook that would be activated when a file that is under git reposi开发者_如何学Pythontory is visited. But other solutions are welcome as well.


You can try git.el or other alternatives listed here : http://www.emacswiki.org/emacs/Git


you can use function (vc-backend "file-name") from VC package to obtain information about given file. This function returns name of version control system, where this file is registered. To run your own code, you can combine this function with standard find-file-hook


eproject runs a hook when visiting a file contained in a git repository.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号