When I upgrade packages in the M-x list-packages menu, the docstrings and locations of the function definitions are invalid so that describe-function gives an error and find-function does not jump to the correct file. For example, running M-x describe-function on slime yields a help buffer that shows the following:

slime is an interactive compiled Lisp function.

(slime &optional ARG1 ARG2)

Cannot open doc string file "/home/user/.emacs.d/elpa/slime-20150501.137/slime.elc"


Running M-x find-function on slime yields the following (I have debug-on-error set to t):

Debugger entered--Lisp error: (error "Can't find library /home/user/.emacs.d/elpa/slime-20150501.137/slime.el")
  signal(error ("Can't find library /home/user/.emacs.d/elpa/slime-20150501.137/slime.el"))
  error("Can't find library %s" "/home/user/.emacs.d/elpa/slime-20150501.137/slime.el")
  find-function-search-for-symbol(slime nil "/home/user/.emacs.d/elpa/slime-20150501.137/slime.elc")
  find-definition-noselect(slime nil)
  find-function-do-it(slime nil switch-to-buffer)
  call-interactively(find-function nil nil)

Is there a way to fix this that doesn't require restarting Emacs?

  • Probably. But could you please file a bug for it? It's something that should be fixed in master anyway. – Malabarba May 5 '15 at 16:48
  • @Malabarba I'll do that but in the meantime I'm still interested in a solution. – Qudit May 5 '15 at 18:42
  • Your description of the problem is not very good. "stop working" and "do not work as they should" mean what, exactly? This risks being closed as unclear or too broad, so you might want to try to specify the problem a bit better. What do you see, and what did you expect to see instead? – Drew May 5 '15 at 20:20
  • @Drew It should be clear what the problem is when running the offending functions after an upgrade. However, my latest edit should remove any ambiguity. – Qudit May 5 '15 at 23:25
  • It is now over two years since this question was asked. I could not find an emacs bug on it and it is still not fixed. I submitted a bug report a week ago. Still waiting for response. I hope this gets fixes as it the main reason for me to restart my emacs. – Heikki May 26 '17 at 11:59

A solution is to load that package again: M-x load-library <package>

I have seen the same problem. I believe it is because the docstrings etc. are "pointing" to the old version of the code which was deleted when you upgraded the package. By loading it you reset these links.

  • 1
    Perhaps it is even best to run unload-feature on the package after an upgrade, and then run load-library to get things extra clean. – Jordon Biondo May 6 '15 at 13:28
  • Restarting Emacs also worked for me. – GDP2 Aug 23 '16 at 3:26

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.