@@ -407,16 +407,16 @@ Save COMMAND to `extended-command-history'."
407
407
(helm-mode 1 ))
408
408
(read-extended-command )))))
409
409
410
- (defun helm-M-x--mode-predicate (sym cur -mode )
410
+ (defun helm-M-x--mode-predicate (sym mj -mode lmm-modes )
411
411
" Check if symbol SYM is suitable for current mode CUR-MODE.
412
412
This predicate honors commands defined with the `interactive' MODES argument."
413
413
(let ((modes (command-modes sym)))
414
414
(and (commandp sym)
415
415
(if modes
416
- (or (memq cur -mode modes)
417
- (memq ( car modes)
418
- ( buffer-local-value 'local-minor-modes helm-current-buffer) )
419
- (memq ( car modes) global-minor-modes))
416
+ (or (memq mj -mode modes)
417
+ (cl-loop for m in modes thereis
418
+ ( or ( memq m lmm-modes )
419
+ (memq m global-minor-modes)) ))
420
420
t ))))
421
421
422
422
;;;### autoload
@@ -438,11 +438,13 @@ You can get help on each command by persistent action."
438
438
(list current-prefix-arg)))
439
439
(if (or defining-kbd-macro executing-kbd-macro)
440
440
(helm-M-x--vanilla-M-x)
441
- (helm-M-x-read-extended-command
442
- obarray (if (and (fboundp 'command-modes )
443
- helm-M-x-exclude-unusable-commands-in-mode)
444
- (lambda (sym ) (helm-M-x--mode-predicate sym major-mode))
445
- #'commandp ))))
441
+ (let ((lmm-modes (buffer-local-value 'local-minor-modes (current-buffer )))
442
+ (mj-mode major-mode))
443
+ (helm-M-x-read-extended-command
444
+ obarray (if (and (fboundp 'command-modes )
445
+ helm-M-x-exclude-unusable-commands-in-mode)
446
+ (lambda (sym ) (helm-M-x--mode-predicate sym mj-mode lmm-modes))
447
+ #'commandp )))))
446
448
(put 'helm-M-x 'interactive-only 'command-execute )
447
449
448
450
(provide 'helm-command )
0 commit comments