Closed hyOzd closed 10 years ago
Are you loading helm-mu before helm is configured? If yes, please reverse the order. helm-mu is trying to add an entry to a menu that is created by helm during startup.
Adding (require 'helm-config)
before helm-mu solved the issue. Thanks.
Great!
I just hit this same issue. Might be good to add a note to the readme.
How about checking if helm-config
is already loaded before adding helm-mu's menus, for example,
(when (featurep 'helm-config)
(easy-menu-add-item nil '("Tools" "Helm" "Tools") ["Mu" helm-mu t])
(easy-menu-add-item nil '("Tools" "Helm" "Tools") ["Mu contacts" helm-mu-contacts t]))
or
(eval-after-load "helm-config"
'(progn
(easy-menu-add-item nil '("Tools" "Helm" "Tools") ["Mu" helm-mu t])
(easy-menu-add-item nil '("Tools" "Helm" "Tools") ["Mu contacts" helm-mu-contacts t])))
or always make sure helm menu is added.
(require 'helm-easymenu)
(easy-menu-add-item nil '("Tools" "Helm" "Tools") ["Mu" helm-mu t])
(easy-menu-add-item nil '("Tools" "Helm" "Tools") ["Mu contacts" helm-mu-contacts t])
@t-jones Yes. I thought I had added something but that was in fact in the documentation of another helm source.
Thank you @xuchunyang. I think all three solutions look good. However, it's really the user's responsibility to make sure helm is configured properly. So another solution would be to check for
(feature-p helm-config)
and throw an error if it's absent (fail-fast principle).
@t-jones Added a note in 9bd7e9b605905e9e584f0c689c9c0b87bbeed590.
@xuchunyang Added a version of your first proposal in 164684c64b86ae46db39391f93465ea6b5434715. If (not (featurep 'helm-config))
, a warning is dispalyed.
This warning incorrectly fires with a config like this:
(use-package helm-config :ensure helm)
(use-package helm-mu)
It seems like with use-package, the featurep detects helm
but not helm-config
. Not sure if this is a bug in use-package not, but relevant here.
Yeah I'd like to include helm-mu
as a part of a Spacemacs layer but I've ran into the issue described by @justmytwospence as Spacemac uses use-package
to manage its layers.
This sounds like an issue for helm or use-package or both. However, if there is a workaround that we can add to helm-mu, let me know, or even better make a PR.
I created an issue with spacemacs at https://github.com/syl20bnr/spacemacs/issues/4363
Following Thierry Volpiatto's recommendation, I now require helm-easymenu. I also dropped the warning that was emitted when helm-config was not present. See 5cb7166b88bcd851cabe0ce0007fe59914e1a4df.
When I add
(require 'helm-mu)
to my .emacs file, emacs fails at startup. Here is the backtrace message with--debug-init
:But if I run
(require 'helm-mu)
from scratch buffer after emacs started, there is no problem. helm-mu works as expected. Using autoload method also works.Emacs version 24.3.1.