Jasmine Lognnes
Jasmine Lognnes

Reputation: 7107

How to add perl-mode.el to .emacs?

If I do M-x load-file RET /root/.elisp/perl-mode.el RET then this perl-mode.el get loaded correctly.

If I in .emacs add any of these, it doesn't work

(load "/root/.elisp/perl-mode.el")
(load-file "/root/.elisp/perl-mode.el")

I am using emacs 24.1.1.

The error I get is

File mode specification error: (void-function setq-local)

Question

What is the correct way to load perl-mode.el from .emacs?

Upvotes: 1

Views: 295

Answers (1)

legoscia
legoscia

Reputation: 41618

The macro setq-local was introduced in Emacs 24.3, so this version of perl-mode is too new for the Emacs you're currently running (24.1).

You could upgrade Emacs, or you could just put the definition of setq-local into your .emacs (from here):

(defmacro setq-local (var val)
  "Set variable VAR to value VAL in current buffer."
  ;; Can't use backquote here, it's too early in the bootstrap.
  (list 'set (list 'make-local-variable (list 'quote var)) val))

Upvotes: 3

Related Questions