emacs-bug-tracker
[Top][All Lists]
Advanced

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

[debbugs-tracker] bug#24238: closed (25.1.50; error in capf in sh-script


From: GNU bug Tracking System
Subject: [debbugs-tracker] bug#24238: closed (25.1.50; error in capf in sh-script if imenu-index is empty )
Date: Sun, 16 Oct 2016 13:58:01 +0000

Your message dated Sun, 16 Oct 2016 16:57:11 +0300
with message-id <address@hidden>
and subject line Re: bug#24238: 25.1.50; error in capf in sh-script if 
imenu-index is empty
has caused the debbugs.gnu.org bug report #24238,
regarding 25.1.50; error in capf in sh-script if imenu-index is empty  
to be marked as done.

(If you believe you have received this mail in error, please contact
address@hidden)


-- 
24238: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=24238
GNU Bug Tracking System
Contact address@hidden with problems
--- Begin Message --- Subject: 25.1.50; error in capf in sh-script if imenu-index is empty Date: Mon, 15 Aug 2016 20:19:16 +0200 User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)
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.

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
-ap



--- End Message ---
--- Begin Message --- Subject: Re: bug#24238: 25.1.50; error in capf in sh-script if imenu-index is empty Date: Sun, 16 Oct 2016 16:57:11 +0300 User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Thunderbird/50.0
Version: 25.2

On 16.10.2016 14:29, Andreas Politz wrote:

No, I don't.

OK, I pushed it to emacs-25. Thanks for the patch.



--- End Message ---

reply via email to

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