]> git.eshelyaron.com Git - emacs.git/commitdiff
Catch the imenu-unavailable error in sh-mode completion table
authorAndreas Politz <politza@hochschule-trier.de>
Sun, 16 Oct 2016 13:56:25 +0000 (16:56 +0300)
committerDmitry Gutov <dgutov@yandex.ru>
Sun, 16 Oct 2016 13:56:25 +0000 (16:56 +0300)
* lisp/progmodes/sh-script.el (sh--cmd-completion-table):
Catch the imenu-unavailable error (bug#24238).

lisp/progmodes/sh-script.el

index f089c81fe56f1c50e8b7a1f29467462f51f290a9..0040adc2c2bde4e4beac4006440db772cba6c41e 100644 (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