5

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"

[back]

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-library-name("/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-function-noselect(slime)
  find-definition-noselect(slime nil)
  find-function-do-it(slime nil switch-to-buffer)
  find-function(slime)
  call-interactively(find-function nil nil)
  command-execute(find-function)

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

5
  • Probably. But could you please file a bug for it? It's something that should be fixed in master anyway.
    – Malabarba
    Commented May 5, 2015 at 16:48
  • @Malabarba I'll do that but in the meantime I'm still interested in a solution.
    – Qudit
    Commented May 5, 2015 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
    Commented May 5, 2015 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
    Commented May 5, 2015 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
    Commented May 26, 2017 at 11:59

1 Answer 1

5

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.

2
  • 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. Commented May 6, 2015 at 13:28
  • Restarting Emacs also worked for me.
    – GDP2
    Commented Aug 23, 2016 at 3:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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