emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] emacs-25 55ebb70: Catch the imenu-unavailable error in sh-


From: Dmitry Gutov
Subject: [Emacs-diffs] emacs-25 55ebb70: Catch the imenu-unavailable error in sh-mode completion table
Date: Sun, 16 Oct 2016 13:56:44 +0000 (UTC)

branch: emacs-25
commit 55ebb708cf65156085003ea0e5cd08a06353be05
Author: Andreas Politz <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    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).
---
 lisp/progmodes/sh-script.el |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index f089c81..0040adc 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]