0

I'm on Windows. I updated my emacs to 24.4. Now, when trying to open a file that has its extension mapped to the Visual Basic mode at http://www.emacswiki.org/emacs/visual-basic-mode.el, I get these errors:

file mode specification error (void-variable \\)

Debug stack trace:

Debugger entered--Lisp error: (void-variable \\)
  eval-buffer(#<buffer  *load*> nil "d:/Program Files/emacs/share/emacs/site-lisp/visual-basic-mode.el" nil t)  ; Reading at buffer position 69251
  load-with-code-conversion("d:/Program Files/emacs/share/emacs/site-lisp/visual-basic-mode.el" "d:/Program Files/emacs/share/emacs/site-lisp/visual-basic-mode.el" nil t)
  visual-basic-mode()
  set-auto-mode-0(visual-basic-mode nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(t t)
  find-file-noselect-1(#<buffer file.vbs> "d:/file.vbs" nil nil "d:/file.vbs" nil)
  find-file-noselect("d:/file.vbs" nil nil t)
  find-file("d:/file.vbs" t)
  call-interactively(find-file nil nil)
  command-execute(find-file)
4
  • Reading at buffer position 69251
    – politza
    Jan 30, 2015 at 23:30
  • Did you get visual-basic-mode off of the EmacsWiki, by any chance? The debug message says there's a problem at position 69251 ((goto-char 69251)), which is the first non-comment line after (provide 'visual-basic-mode). It looks like there's a lot of junk from here to the bottom of the file; try commenting it all out and see if it works for you.
    – Dan
    Jan 31, 2015 at 1:02
  • @Dan Indeed that was the problem. A part of the code was repeated. I removed that junk from the EmacsWiki and now it works.
    – marczellm
    Jan 31, 2015 at 9:02
  • Great! I'll switch the comment to an answer so we can close this question.
    – Dan
    Jan 31, 2015 at 12:31

1 Answer 1

1

The debug message says that there's a problem at position 69251, so you can visit visual-basic-mode.el and (goto-char 69251) to inspect the text and see what the problem is.

It turns out that, if you're using the file from the EmacsWiki, position 69251 corresponds to the first non-comment line after (provide 'visual-basic-mode). There's a lot of junk from here to the bottom of the file, so it looks like someone accidentally pasted some scratch work here and forgot to remove it. Either comment it out or delete it, and you should be fine.

1
  • 1
    I'll add this: as anyone can edit EmacsWiki, I removed the junk so the version found there is now fixed.
    – marczellm
    Jan 31, 2015 at 12:33

Your Answer

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

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