I'm facing a weird issue in my init.el
. Installing packages such as json-mode
or puppet-mode
(from MELPA Stable) with use-package
unsets common functions like forward-word
or backward-kill-word
. The key bindings are unaffected, the function is simply missing (I get Symbol’s function definition is void: nil
). This behavior does not happen with all packages (I have dozens of other packages in my init.el
which work just fine).
Here is a minimal init.el
:
(require 'package)
(setq package-enable-at-startup nil)
(add-to-list 'package-archives '("melpa-stable" . "https://stable.melpa.org/packages/"))
(when (< emacs-major-version 24)
(add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
(package-initialize)
(unless (package-installed-p 'use-package)
(package-refresh-contents)
(package-install 'use-package)
)
(eval-when-compile (require 'use-package))
(setq use-package-always-ensure t)
(use-package json-mode
:mode ("\\.json"))
(use-package puppet-mode
:mode ("\\.pp"))
Running Emacs with a complete clean .emacs.d
(apart from the init file) first installs use-package
along with diminish
and bind-key
and then downloads the two modes json-mode
and puppet-mode
and adds them to the load-path (as expected).
However, opening a text file test.txt
and then running M-f
or M-x forward-word
returns the error:
Symbol’s function definition is void: nil
I'm running Emacs 25.1.1
Is this an issue with these packages, or am I doing something wrong?
Can anyone reproduce this problem?
:mode
regexps with\\'
, which means "end of string", e.g.:mode "\\.json\\'"
.