Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix "Source file newer than byte-compiled file" error?

Tags:

emacs

elisp

I'm getting the error

Source file `~/.emacs.d/elpa/cmake-mode-20110824/cmake-mode.el' newer than byte-compiled file

when I attempt to open a CMakeLists.txt file in cmake-mode.

My .emacs consists (in part) of the following:

(setq load-path (cons 
             (expand-file-name "~/.emacs.d/elpa/cmake-mode-20110824") 
             load-path))
(require 'cmake-mode)
(setq auto-mode-alist
      (append '(("CMakeLists\\.txt\\'" . cmake-mode)
            ("\\.cmake\\'" . cmake-mode))
              auto-mode-alist))

The backtrace:

Debugger entered--Lisp error: (wrong-type-argument char-table-p nil)
  char-table-parent(nil)
  cmake-mode()
  set-auto-mode-0(cmake-mode nil)
  set-auto-mode()
  normal-mode(t)
  after-find-file(nil t)
  find-file-noselect-1(#<buffer CMakeLists.txt> "~/CMakeLists.txt" nil nil   "~/CMakeLists.txt" (19923691 2049))
  find-file-noselect("~/CMakeLists.txt" nil nil t)
  find-file("~/CMakeLists.txt" t)
  call-interactively(find-file nil nil)

I'm confused by why this error is occurring. Disclaimer: I am an emacs and elisp noob.

like image 343
Dodgie Avatar asked Mar 21 '14 07:03

Dodgie


1 Answers

The problem is probably within your cmake-mode which is quite outdated. Here's how to fix it:

  1. Remove all your setup from above
  2. Make sure that you have emacs24
  3. In your ~/.emacs:

    (package-initialize)
    (add-to-list 'package-archives
      '("melpa" . "http://melpa.milkbox.net/packages/"))
    
  4. M-x package-list-packages. Find cmake-mode with C-s. Mark for installation with i and install with x.

like image 178
abo-abo Avatar answered Oct 30 '22 04:10

abo-abo