0

I use the package vimish-fold.

The package contains, for example, two functions, called as:

Function 1
Function 2

There is a new commit to the package vimish-fold on Github, which will add the new function 3. But the changes are not reflected yet in MELPA. I wanted to try it out, so I upgrade it manually.

I made the mistake of changing the contents of the package manually.

I copied the new code from Github, pasted the new code over the old code in the .el-file in the same package. And in the same package, I bytecompiled manually the .el-file in the same directory. So the .elc-file is also updated.

After restarting Emacs, I don't see the function 3 appearing when calling the commands lists with M-x.

After that, I deleted the package vimish-fold in package.el and reinstalled it. I waited until the update for vimish-fold appeared in MELPA, and update it with package.el.

In the same Emacs session, the new features of vimish-fold works fine, like function 3. But when I restarted Emacs, I see the new commands when I do M-x:

Function 1
Function 2
Function 3

I call the function 3, I get the message "Autoloading failed to define function function 3" But the function 1 and function 2 works fine, except the new function 3. So I guess somewhere the old package is still active. Then I remove the package vimish-fold in package.el, and reinstall it. In the same Emacs session the function 3 works again. But when I restarted Emacs, Function 3 is visible in the list of all commands, but I get the same error when I call the function 3.

So it seems the right package is enabled, but I get the autoloading fail error again. Note this is after deleting and reinstall the same package with the MELPA package manager/paradox.

It seems the others also struggled with the same issue. Without any succes. When I do a grep, I can't find any other same package as vimish-fold. Notice that I use Windows, and I have my .emacs.d in my PATH.

Any suggestion in order to solve it?

  • 4
    My crystal ball tells me that M-x list-load-path-shadows RET might give you a clue (IOW it's not a ghost, just a shadow). – Stefan Sep 29 '15 at 19:54
  • @Stefan thanks for your reply. The M-x list-load-path-shadows RET helped me to find the culprit. This issue is solved by now. – ReneFroger Sep 30 '15 at 10:15
0

To install a package from a package file (in your case, that is vimish-fold.el) with package.el, you can use package-install-from-buffer or package-install-file. It will byte-compile elisp code AND create an autoload file correspondingly. Thus,

I bytecompiled manually the .el-file in the same directory. So the .elc-file is also updated.

is not enough, then it will happen:

After restarting Emacs, I don't see the function 3 appearing when calling the commands lists with M-x.


While using pakckage.el, for safety, you usually need to keep only one specific version and can activate only one specific version, so remove duplicate package of different versions if you have. and don't install package again manually, that is, put vimish-fold.el into somewhere of your load-path by yourself.


I don't understand your other questions.

  • Your answers focus on my previous mistake of changing the contents of the package. After that, I deleted the package vimish-fold in package.el and reinstalled it. In same emacs session, the new features of vimish-fold works fine. But when I restarted Emacs, I see the new commands when I do <kbd>M-x</kbd>, but when I'm calling it, I get the message: "Autoloading failed to define function vimish-fold-toggle". How can I solve it? – ReneFroger Sep 29 '15 at 18:27
  • @ReneFroger That error message means "vimish-fold-toggle is an autoload command from vimish-fold.el, but actually, the actived vimish-fold.el doesn't define that command" – xuchunyang Sep 30 '15 at 4:05
  • @ReneFroger You have to make sure the version of vimish-fold, which has the autoload vimish-fold-toggle command, is activated in package.el, the way to check is to use C-h P of find-function. – xuchunyang Sep 30 '15 at 4:17
0

This issue of "Autoloading failed to define function" is solved now. Try M-x list-load-path-shadows to get a clue which packages are conflicting.

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.