]> code.delx.au - gnu-emacs-elpa/blobdiff - company-elisp.el
Support 'stop return value for 'prefix command.
[gnu-emacs-elpa] / company-elisp.el
index d902c4d8245167d6fbee196dc471943b45e9b123..a501efef86f890cece45dfd6f90b9abb36b82166 100644 (file)
@@ -28,12 +28,9 @@ Functions are offered for completion only after ' and \(."
   :type '(choice (const :tag "Off" nil)
                  (const :tag "On" t)))
 
-(defvar company-lisp-symbol-regexp
-  "\\_<\\(\\sw\\|\\s_\\)+\\_>\\=")
-
 (defun company-grab-lisp-symbol ()
-  (let ((prefix (or (company-grab company-lisp-symbol-regexp) "")))
-    (unless (and (company-in-string-or-comment (- (point) (length prefix)))
+  (let ((prefix (company-grab-symbol)))
+    (unless (and (company-in-string-or-comment)
                  (/= (char-before (- (point) (length prefix))) ?`))
       prefix)))
 
@@ -112,7 +109,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)
-                  (company-grab-lisp-symbol)))
+                  (or (company-grab-lisp-symbol) 'stop)))
     ('candidates (company-elisp-candidates arg))
     ('meta (company-elisp-doc arg))
     ('doc-buffer (let ((symbol (intern arg)))