diff options
author | Michael Heerdegen <michael_heerdegen@web.de> | 2015-03-01 00:59:40 +0100 |
---|---|---|
committer | Michael Heerdegen <michael_heerdegen@web.de> | 2015-03-01 00:59:40 +0100 |
commit | 9e40ab299d2e7420e415522713a3b6a6d8a87061 (patch) | |
tree | 6f8e32509d201028e31be0144455da1f3bd72f04 /helm-misc.el | |
parent | a070d766c5d62323f4a56fae83db85ff1db990e9 (diff) |
helm-browse-menubar: use multiple sources instead of prefix arg (fix #885)
Diffstat (limited to 'helm-misc.el')
-rw-r--r-- | helm-misc.el | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/helm-misc.el b/helm-misc.el index d51f50b7..96086c19 100644 --- a/helm-misc.el +++ b/helm-misc.el @@ -141,21 +141,16 @@ current local map, current global map, and all current minor maps." (lacarte-get-overall-menu-item-alist maps))) ;;;###autoload -(defun helm-browse-menubar (arg) - "Helm interface to the menubar using lacarte.el. -With no prefix arg call the local current major-mode menu, -with one prefix arg call the global menu, -with two prefix args call the menu for the possible minor-mode in effect." - (interactive "P") +(defun helm-browse-menubar () + "Helm interface to the menubar using lacarte.el." + (interactive) (require 'lacarte) - (helm :sources (helm-make-source "Lacarte" 'helm-lacarte - :candidates (lambda () - (helm-lacarte-get-candidates - (cond ((equal arg '(4)) - '(global)) - ((equal arg '(16)) - '(minor)) - (t '(local)))))) + (helm :sources (mapcar + (lambda (spec) (helm-make-source (car spec) 'helm-lacarte + :candidates (lambda () (helm-lacarte-get-candidates (cdr spec))))) + '(("Major Mode" . (local)) + ("Minor Modes" . (minor)) + ("Global Map" . (global)))) :buffer "*helm lacarte*")) (defun helm-call-interactively (cmd-or-name) |