]> code.delx.au - gnu-emacs-elpa/commitdiff
Use 'company-keep property instead of hard-coded command list.
authorNikolaj Schumacher <git@nschum.de>
Sun, 22 Mar 2009 12:47:10 +0000 (13:47 +0100)
committerNikolaj Schumacher <git@nschum.de>
Sun, 22 Mar 2009 15:59:04 +0000 (16:59 +0100)
company.el

index 66cbe3fcdff7af86d82c2fe7bd7e8e2c65403180..7d482ce30dee1703fd2c5090d26a22a7c23f0473 100644 (file)
@@ -586,8 +586,11 @@ keymap during active completions (`company-active-map'):
   ;; Don't start again, unless started manually.
   (setq company-point (point)))
 
   ;; Don't start again, unless started manually.
   (setq company-point (point)))
 
+(defsubst company-keep (command)
+  (and (symbolp command) (get command 'company-keep)))
+
 (defun company-pre-command ()
 (defun company-pre-command ()
-  (unless (eq this-command 'company-show-doc-buffer)
+  (unless (company-keep this-command)
     (condition-case err
         (when company-candidates
           (company-call-frontends 'pre-command))
     (condition-case err
         (when company-candidates
           (company-call-frontends 'pre-command))
@@ -599,7 +602,7 @@ keymap during active completions (`company-active-map'):
   (company-uninstall-map))
 
 (defun company-post-command ()
   (company-uninstall-map))
 
 (defun company-post-command ()
-  (unless (eq this-command 'company-show-doc-buffer)
+  (unless (company-keep this-command)
     (condition-case err
         (progn
           (unless (equal (point) company-point)
     (condition-case err
         (progn
           (unless (equal (point) company-point)
@@ -915,6 +918,7 @@ when the selection has been changed, the selected candidate is completed."
           (when last-input-event
             (clear-this-command-keys t)
             (setq unread-command-events (list last-input-event))))))))
           (when last-input-event
             (clear-this-command-keys t)
             (setq unread-command-events (list last-input-event))))))))
+(put 'company-show-doc-buffer 'company-keep t)
 
 ;;; pseudo-tooltip ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 
 ;;; pseudo-tooltip ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;