From 536badf9a7823ebbf252d078a20901060159ca80 Mon Sep 17 00:00:00 2001 From: Peng Li Date: Mon, 21 Nov 2016 11:40:55 +0800 Subject: [PATCH] emacs - mapping SPACE in company active mode to workaround a semantic issue https://github.com/company-mode/company-mode/issues/614 --- emacs.d/config.org | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/emacs.d/config.org b/emacs.d/config.org index 77e72b0..9cfa09a 100644 --- a/emacs.d/config.org +++ b/emacs.d/config.org @@ -1977,6 +1977,7 @@ here on Mac, just use "open" commands to pen =.pdf=, =.html= and image files :config (define-key company-active-map (kbd "M-n") nil) (define-key company-active-map (kbd "M-p") nil) + (define-key company-active-map (kbd "SPC") #'sd/company-stop-input-space) (define-key company-active-map (kbd "C-n") #'company-select-next) (define-key company-active-map (kbd "C-p") #'company-select-previous) ;; should map both (kbd "TAB") and [tab],https://github.com/company-mode/company-mode/issues/75 @@ -1990,6 +1991,12 @@ here on Mac, just use "open" commands to pen =.pdf=, =.html= and image files :ensure t :config (company-statistics-mode)) + + (defun sd/company-stop-input-space () + "Stop completing and input a space,a workaround of a semantic issue `https://github.com/company-mode/company-mode/issues/614'" + (interactive) + (company-abort) + (insert " ")) #+END_SRC ** YASnippet -- 2.11.0