joostkremers / pandoc-mode

An Emacs minor mode for interacting with Pandoc.
https://joostkremers.github.io/pandoc-mode/
178 stars 14 forks source link

duplicates in hydra menus #120

Closed newhallroad closed 2 months ago

newhallroad commented 3 months ago

Using pandoc-mode 20240602.1006 in GNU Emacs 29.1 on Windows 10.

Hydra menus have duplicate listings. eg under options -> reader options, or options -> citations, the menu items are listed and then all repeated. This doesn't seem to affect functionality, but it does make the package difficult to use because the menus are very large and extend below the bottom of the screen.

I have made sure that no previous versions of the package exist and no other directories of previous versions still exist in the elpa directory in .emacs.d.

HUGE thanks as always for your amazing contributions to the community.

joostkremers commented 3 months ago

I've seen this happening sometimes when updating the package. I'm not sure exactly why it happens, but the only way I've found to resolve it is to delete the package, restart Emacs and reinstall.

newhallroad commented 2 months ago

Thank you for your reply, and apologies for the long delay in responding.

In the past I have been able to solve the problem in the way you suggested - deleting and reinstalling. On this occasion that didn't work no matter how many times I did so. I got the the bottom of this in the end, though. I think (though I'm not sure) that the issue was the auto-compile package in my config. When I updated to a newer version of pandoc-mode, emacs was somehow also running the compiled version, at least for the menus. (Is that possible??)

In any case, adding the following to the :config section of the auto-compile package solved the problem:

(use-package auto-compile
  :ensure t
  :config
  (auto-compile-on-load-mode)
  (auto-compile-on-save-mode)
  )

Adding it close to the start of my .emacs makes all packages recompile if the compiled versions are older than the packages themselves. To be honest, I don't know for sure if this is what cause the issue for me, but it seems to have solved my problem with the hydra menus so I wanted to report back in case it helps others in the future.

joostkremers commented 2 months ago

Part of the problem is probably the way pandoc-mode (ab)uses hydras... They're meant to be created statically, but pandoc-mode creates them dynamically. But I don't have much time to look into this right now, so I'm glad you found a solution. Thanks for reporting back here, in case others run into the same issue.