]> code.delx.au - gnu-emacs-elpa/blobdiff - company-elisp.el
Give some feedback when no completion was found.
[gnu-emacs-elpa] / company-elisp.el
index 74f88972c9d29f2118faf50e23c427b80395f552..4c68cbb8f16442f40f95aea1403903a53b3de94b 100644 (file)
@@ -2,7 +2,7 @@
 ;;
 ;; Copyright (C) 2009 Nikolaj Schumacher
 ;;
-;; This file is part of company 0.3.
+;; This file is part of company 0.4.3.
 ;;
 ;; This program is free software; you can redistribute it and/or
 ;; modify it under the terms of the GNU General Public License
@@ -30,9 +30,11 @@ Functions are offered for completion only after ' and \(."
 
 (defun company-grab-lisp-symbol ()
   (let ((prefix (company-grab-symbol)))
-    (unless (and (company-in-string-or-comment (- (point) (length prefix)))
-                 (/= (char-before (- (point) (length prefix))) ?`))
-      prefix)))
+    (if prefix
+        (unless (and (company-in-string-or-comment)
+                     (/= (char-before (- (point) (length prefix))) ?`))
+          prefix)
+      'stop)))
 
 (defun company-elisp-predicate (symbol)
   (or (boundp symbol)
@@ -43,7 +45,7 @@ Functions are offered for completion only after ' and \(."
 
 (defvar company-elisp-binding-regexp
   (concat "([ \t\n]*\\_<" (regexp-opt '("let" "defun" "defmacro" "defsubst"
-                                        "lambda" "lexical-let"))
+                                        "lambda" "lexical-let" "flet" "labels"))
           "\\*?")
   "Regular expression matching sexps containing variable bindings.")