I try to write a function to abstract which helm-imenu
variant to use:
(defun my/helm-menu ()
"For Org mode buffers, show Org headlines.
For programming mode buffers, show functions, variables, etc."
(interactive)
(cond ((derived-mode-p 'org-mode)
(helm-org-in-buffer-headings))
(t
(helm-semantic-or-imenu))))
Though, when using it in a non-Org mode buffer, it fails, saying it needs one argument.
Indeed, helm-semantic-or-imenu
requires arg
.
How should I pass that?
Why is that working with a M-x helm-semantic-or-imenu
: where is the argument?
Following Drew's piece of advice, this should do it:
At least, it works!