branch: externals/matlab-mode
commit 4c3064f8b22e9a96abb915aa3aa3004aa48d7989
Author: John Ciolfi <john.ciolfi...@gmail.com>
Commit: John Ciolfi <john.ciolfi...@gmail.com>

    matlab-shell: fix TAB completion startup error
    
    Fix: when MATLAB starts and before we get to the prompt, typing TAB causes
      matlab-shell-do-completion-light: Wrong type argument: 
number-or-marker-p, nil
    because there is nothing to complete.
---
 matlab-shell.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/matlab-shell.el b/matlab-shell.el
index 91d303567f..400de38824 100644
--- a/matlab-shell.el
+++ b/matlab-shell.el
@@ -1609,9 +1609,9 @@ installed, then use company to display completions in a 
popup window."
          (completion-info        (matlab-shell-get-completion-info))
          (completions            (cdr (assoc 'completions completion-info)))
          (common-substr-start-pt (cdr (assoc 'common-substr-start-pt 
completion-info)))
-         (common-substr-end-pt   (cdr (assoc 'common-substr-end-pt 
completion-info)))
-         )
-    (completion-in-region common-substr-start-pt common-substr-end-pt 
completions)))
+         (common-substr-end-pt   (cdr (assoc 'common-substr-end-pt 
completion-info))))
+    (when (and common-substr-start-pt common-substr-end-pt)
+      (completion-in-region common-substr-start-pt common-substr-end-pt 
completions))))
 
 (defun matlab-shell-do-completion ()
   "Perform completion using Emacs buffers.

Reply via email to