summaryrefslogtreecommitdiff
path: root/lisp/progmodes/sh-script.el
diff options
context:
space:
mode:
authorAndreas Politz <politza@hochschule-trier.de>2016-10-16 16:56:25 +0300
committerDmitry Gutov <dgutov@yandex.ru>2016-10-16 16:56:25 +0300
commit55ebb708cf65156085003ea0e5cd08a06353be05 (patch)
tree8eec87e71ce382d8b068f86f3ffb3cc727d3be57 /lisp/progmodes/sh-script.el
parent993acb5088a9766f3af240edcb9c6ffb93530034 (diff)
downloademacs-55ebb708cf65156085003ea0e5cd08a06353be05.tar.gz
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).
Diffstat (limited to 'lisp/progmodes/sh-script.el')
-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 f089c81fe56..0040adc2c2b 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -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