diff options
author | Wilfred Hughes <me@wilfred.me.uk> | 2015-08-09 16:47:37 +0100 |
---|---|---|
committer | Wilfred Hughes <me@wilfred.me.uk> | 2015-08-09 16:47:37 +0100 |
commit | f067bcbd3433c431c10c900e2f4bae0d057f0af2 (patch) | |
tree | 6257fbc63b35bf0d1f4638199b0a4cc6eac6e1b4 /helm-command.el | |
parent | cc28ae32c3e52888b3f7198bb4cda4813476b666 (diff) |
Handle a mode-map being nil.
This occurs in llvm-mode, where llvm-mode-map is nil.
Diffstat (limited to 'helm-command.el')
-rw-r--r-- | helm-command.el | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/helm-command.el b/helm-command.el index 34565c62..5f5aef82 100644 --- a/helm-command.el +++ b/helm-command.el @@ -67,10 +67,11 @@ Show all candidates on startup when 0 (default)." (cl-defun helm-M-x-get-major-mode-command-alist (mode-map) "Return alist of MODE-MAP." - (cl-loop for key being the key-seqs of mode-map using (key-bindings com) - for str-key = (key-description key) - for ismenu = (string-match "<menu-bar>" str-key) - unless ismenu collect (cons str-key com))) + (when mode-map + (cl-loop for key being the key-seqs of mode-map using (key-bindings com) + for str-key = (key-description key) + for ismenu = (string-match "<menu-bar>" str-key) + unless ismenu collect (cons str-key com)))) (defun helm-get-mode-map-from-mode (mode) "Guess the mode-map name according to MODE. |