GNU bug report logs -
#24238
25.1.50; error in capf in sh-script if imenu-index is empty
Previous Next
Reported by: Andreas Politz <politza <at> hochschule-trier.de>
Date: Mon, 15 Aug 2016 18:20:01 UTC
Severity: minor
Tags: patch
Found in version 25.1.50
Fixed in version 25.2
Done: Dmitry Gutov <dgutov <at> yandex.ru>
Bug is archived. No further changes may be made.
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
The completion function sh--cmd-completion-table in sh-script.el may use
imenu--make-index-alist to create a list of candidates. But this
function signals the error imenu-unavailable, if the index is empty.
This is a commonly the case, e.g. if the scripts is new.
Solution: Catch the error condition.
[sh-script.diff (text/x-diff, inline)]
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index 7a9e6c7..5d362e4 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -1744,7 +1744,10 @@ sh--vars-before-point
(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
[Message part 3 (text/plain, inline)]
-ap
This bug report was last modified 8 years and 278 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.