Catch the imenu-unavailable error in sh-mode completion table

* lisp/progmodes/sh-script.el (sh--cmd-completion-table):
Catch the imenu-unavailable error (bug#24238).
This commit is contained in:
Andreas Politz 2016-10-16 16:56:25 +03:00 committed by Dmitry Gutov
parent 993acb5088
commit 55ebb708cf

View file

@ -1741,7 +1741,10 @@ This adds rules for comments and assignments."
(defun sh--cmd-completion-table (string pred action)
(let ((cmds
(append (when (fboundp 'imenu--make-index-alist)
(mapcar #'car (imenu--make-index-alist)))
(mapcar #'car
(condition-case nil
(imenu--make-index-alist)
(imenu-unavailable nil))))
(mapcar (lambda (v) (concat v "="))
(sh--vars-before-point))
(locate-file-completion-table