Whenever I save my main.el file, I get the following error.

apply: Args out of range: #("Git@" 0 4 (help-echo "Locally added file under the Git version control system" face vc-locally-added-state)), 0, 7

The debug stack looks like this:

Debugger entered--Lisp error: (args-out-of-range #("Git@" 0 4 (help-echo "Locally added file under the Git version control system" face vc-locally-added-state)) 0 7)
  apply(vc-git-mode-line-string "~/emacs_environment/elisp/main.el")
  vc-call-backend(Git mode-line-string "~/emacs_environment/elisp/main.el")
  vc-mode-line("~/emacs_environment/elisp/main.el" Git)
  after-find-file(nil t)
  find-file-noselect-1(#<buffer main.el> "~/emacs_environment/elisp/main.el" nil nil "~/emacs_environment/elisp/main.el" (4325419 2050))
  find-file-noselect("~/emacs_environment/elisp/main.el" nil nil)
  #<subr call-interactively>(ido-find-file nil nil)
  ad-Advice-call-interactively(#<subr call-interactively> ido-find-file nil nil)
  apply(ad-Advice-call-interactively #<subr call-interactively> (ido-find-file nil nil))
  call-interactively(ido-find-file nil nil)

I get the same error whenever I open the buffer. The message displays and the buffer loads, but it doesn't open in the current window. I have to do that explicitly with C-x C-b.

My .emacs looks like this.

(add-to-list 'load-path "~/emacs_environment/elisp")
(require 'main)

This loads the main.el library for me, which itself loads more specific .el libraries. I do it this way so that I can sync the emacs_environment directory across computers.

I get the same error even if I comment out everything in the main.el file.

My emacs_environment directory is a Git repository, and I have magit installed.

My Emacs version is GNU Emacs (x86_64-pc-linux-gnu, GTK+ Version 3.4.2) of 2015-01-09 on lgw01-05.

How can I eliminate the error and have my main.el file open normally?

  • 2
    What is your Emacs version?
    – legoscia
    Jan 19, 2015 at 16:36
  • 1
    version returns GNU Emacs (x86_64-pc-linux-gnu, GTK+ Version 3.4.2) of 2015-01-09 on lgw01-05 Jan 19, 2015 at 16:37
  • This is probably not magit. I'd start by running emacs with --debug-init and see where the error is coming from. Else, set debug-on-error to t and next time you save the file, the stacktrace will show you the reason for why it happens.
    – wvxvw
    Jan 19, 2015 at 17:33
  • I don't have any errors on init though. Jan 19, 2015 at 17:34
  • 1
    Then do M-x toggle-debug-on-error after your init.
    – PythonNut
    Jan 20, 2015 at 0:30

1 Answer 1


I added the following to my main.el:

;; disable vc-git
(setq vc-handled-backends ())

This works for me since I use magit instead of vc-git, but I admit that it's a bit of a nuclear option.

I believe the problem was due to a bug in snapshot, since the problem disappeared when I installed a stable Emacs 24.4.

  • 1
    (vc-mode -1) should also do it.
    – Malabarba
    Jan 22, 2015 at 21:28
  • I tried it, but it seems that (vc-mode -1) does not eliminate the problem. Jan 22, 2015 at 21:46
  • 2
    Do you have a stable version i.e. 24.4 installed? I'd run that and see if you get the same problem. If you don't, then it is likely due to some instability in current dev branch. I would also see about updating your emacs as 6+ weeks for a dev version is pretty old
    – Tim X
    Feb 21, 2015 at 22:55
  • I tried 24.4 stable and the problem disappeared. I'm going to chalk it up to snapshot instability. Feb 23, 2015 at 0:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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