summaryrefslogtreecommitdiff
path: root/lisp/progmodes
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/sh-script.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 7a9e6c7422d..5d362e42c30 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -1744,7 +1744,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