enter image description hereSome of my major modes, installed via ELPA, error during load as, for instance for markdown-mode,

Debugger entered--Lisp error: (file-missing "Cannot open load file" "No such file or directory" "../../../../.emacs.d/elpa/markdown-mode-20210405.1...")
  set-auto-mode-0(markdown-mode nil)
  after-find-file(nil t)

. I've tried understanding why the load-path is relative and doesn't work. But without any clues. Need help.


After having set debug-on-message I've found some more clues.

The error is trigger by the expression

(with-demoted-errors "File mode specification error: %s" (set-auto-mode))

in the function normal-mode when I open a D (.d) file.

Prior to the call to with-demoted-errors the load-path looks ok and does not contain any relative paths. I'm attaching a screen from the EDebug session.

Several other elpa packages such as magit are affected. I don't see any common property of those failing packages.

The let of the variable enable-local-variables sounds suspicious...

  • What is the value stored in your load-path variable? Do you change the value of load-path somewhere in your config?
    – jue
    Apr 13 at 10:00
  • I've studied the value 'load-path, yes. Nothing unusual. So it must be changed temporarily somehow. Can one set a hook that runs when a variable changes?
    – Nordlöw
    Apr 13 at 15:06
  • 1
    I this question needs more information to get a proper answer. I don't think, there is a hook for changing a var, but you could advice setq and setf to do so. If that helps is unclear, due to load-path being a special variable and so its value can temoprarily be modified by let.
    – jue
    Apr 15 at 7:42
  • I'm gonna try (setq debug-on-message "No such file or directory\" \"../../../../.emacs.d/elpa").
    – Nordlöw
    Apr 17 at 21:33
  • I've gained some more insight into the problem. See above.
    – Nordlöw
    Apr 26 at 19:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.