]> rtime.felk.cvut.cz Git - sojka/company-mode.git/commitdiff
Fixed 'stop location in elisp back-end.
authorNikolaj Schumacher <git@nschum.de>
Thu, 16 Apr 2009 15:10:34 +0000 (17:10 +0200)
committerNikolaj Schumacher <git@nschum.de>
Sat, 18 Apr 2009 09:47:07 +0000 (11:47 +0200)
company-elisp.el

index bb0835519d678906a4d9060c87ceaa35fcf72352..b75fcd80a894a8edf0a2206c77d4aaff8c33fb9c 100644 (file)
@@ -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)
-                 (/= (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)
@@ -109,7 +111,7 @@ Functions are offered for completion only after ' and \(."
   (case command
     ('interactive (company-begin-backend 'company-elisp))
     ('prefix (and (eq (derived-mode-p 'emacs-lisp-mode) 'emacs-lisp-mode)
-                  (or (company-grab-lisp-symbol) 'stop)))
+                  (company-grab-lisp-symbol)))
     ('candidates (company-elisp-candidates arg))
     ('meta (company-elisp-doc arg))
     ('doc-buffer (let ((symbol (intern arg)))