1
votes

I have a problem with my .emacs file: everything loads fine, but one minor mode does not load.

Here is the code:

(require 'package)
(add-to-list 'package-archives
         '("melpa" . "http://melpa.milkbox.net/packages/") 1)
(package-initialize)
(add-to-list 'load-path "~/.emacs.d/")
(load "macros")
(load-theme 'zenburn 1)

(set-language-environment "UTF-8")
(savehist-mode 1)
(windmove-default-keybindings 'meta)
(electric-indent-mode -1)
(hl-sexp-mode 1)
(setq TeX-PDF-mode t)

When emacs opens, hl-sexp-mode is disabled, but when I run eval-buffer on the .emacs file, the mode is activated.

What is wrong?

2

2 Answers

3
votes

You should enable the global hl-sexp-mode by replacing (hl-sexp-mode) with (global-hl-sexp-mode) to your init file. hl-sexp-mode enables the mode locally i.e. for the buffer from which it is called, I am not sure what is the current buffer is when Emacs is initializing.

0
votes

Not sure why it works when you use eval-buffer; there doesn't seem to be a hl-sexp-mode function defined (at least in the version on github). Instead of (hl-sexp-mode 1), try (highlight-sexp-mode 1) in its place.