Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm running Emacs on OSX (Emacs24) and on occasion I have to edit files on a mounted sshfs volume. However, Emacs' vc integration -- git, specifically -- is REALLY slow over sshfs mounts.

I'd like to selectively disable vc-mode, either in configuration or using .dir-locals.el. How can I do that?

share|improve this question
add comment

3 Answers

As pmr mentioned, you can remove git from the list of backends.

The default list of backends is (RCS CVS SVN SCCS Bzr Git Hg Mtn Arch)

There are different ways to set variables in emacs.

Just editing your ~/.emacs file and adding the following two lines should do the trick (notice Git is removed from the list)

;; Disable git backend to speed up sshfs file load among other things
(setq vc-handled-backends (quote (RCS CVS SVN SCCS Bzr Hg Mtn Arch)))
share|improve this answer
add comment

I would try modifying the variable vc-handled-backends which my version of Emacs describes as:

vc-handled-backends is a variable defined in `vc-hooks.el'. Its value is (RCS CVS SVN SCCS Bzr Git Hg Mtn Arch)

Documentation: List of version control backends for which VC will be used. Entries in this list will be tried in order to determine whether a file is under that sort of version control. Removing an entry from the list prevents VC from being activated when visiting a file managed by that backend. An empty list disables VC altogether.

You can customize this variable.

This variable was introduced, or its default value was changed, in version 23.1 of Emacs.

share|improve this answer
add comment

I think writing an around-advice for vc-git-registered (or even vc-registered or vc-find-file-hook) would be the best course of action.

In there, you would check the file path or the value of some variable that would be set through .dir-locals.el.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.