* bug#24238: 25.1.50; error in capf in sh-script if imenu-index is empty
@ 2016-08-15 18:19 Andreas Politz
2016-10-16 9:02 ` Dmitry Gutov
0 siblings, 1 reply; 4+ messages in thread
From: Andreas Politz @ 2016-08-15 18:19 UTC (permalink / raw)
To: 24238
[-- Attachment #1: Type: text/plain, Size: 305 bytes --]
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.
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: sh-script.diff --]
[-- Type: text/x-diff, Size: 754 bytes --]
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
[-- Attachment #3: Type: text/plain, Size: 7 bytes --]
-ap
^ permalink raw reply related [flat|nested] 4+ messages in thread
end of thread, other threads:[~2016-10-16 13:57 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-15 18:19 bug#24238: 25.1.50; error in capf in sh-script if imenu-index is empty Andreas Politz
2016-10-16 9:02 ` Dmitry Gutov
2016-10-16 11:29 ` Andreas Politz
2016-10-16 13:57 ` Dmitry Gutov
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.