[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 7c5408c 57/78: company-clang--start-process: Kill the exis
From: |
Dmitry Gutov |
Subject: |
[elpa] master 7c5408c 57/78: company-clang--start-process: Kill the existing process, if any |
Date: |
Sun, 18 Feb 2018 07:40:26 -0500 (EST) |
branch: master
commit 7c5408c40929c1e51460f74eaf0108ed0ad31216
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>
company-clang--start-process: Kill the existing process, if any
Fixes to completions in this case.
To repro: set idle delay to 0, then quickly type two chars.
---
company-clang.el | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
diff --git a/company-clang.el b/company-clang.el
index a8b0098..74846ea 100644
--- a/company-clang.el
+++ b/company-clang.el
@@ -201,12 +201,13 @@ or automatically through a custom
`company-clang-prefix-guesser'."
(goto-char (point-min))))))
(defun company-clang--start-process (prefix callback &rest args)
- (let ((objc (derived-mode-p 'objc-mode))
- (buf (get-buffer-create "*clang-output*"))
- ;; Looks unnecessary in Emacs 25.1 and later.
- (process-adaptive-read-buffering nil))
- (if (get-buffer-process buf)
- (funcall callback nil)
+ (let* ((objc (derived-mode-p 'objc-mode))
+ (buf (get-buffer-create "*clang-output*"))
+ ;; Looks unnecessary in Emacs 25.1 and later.
+ (process-adaptive-read-buffering nil)
+ (existing-process (get-buffer-process buf)))
+ (when existing-process
+ (kill-process existing-process))
(with-current-buffer buf
(erase-buffer)
(setq buffer-undo-list t))
@@ -216,7 +217,7 @@ or automatically through a custom
`company-clang-prefix-guesser'."
(set-process-sentinel
process
(lambda (proc status)
- (unless (string-match-p "hangup" status)
+ (unless (string-match-p "hangup\\|killed" status)
(funcall
callback
(let ((res (process-exit-status proc)))
@@ -228,7 +229,7 @@ or automatically through a custom
`company-clang-prefix-guesser'."
(unless (company-clang--auto-save-p)
(send-region process (point-min) (point-max))
(send-string process "\n")
- (process-send-eof process))))))
+ (process-send-eof process)))))
(defsubst company-clang--build-location (pos)
(save-excursion
- [elpa] master aaae46b 74/78: M-x copyright-update, (continued)
- [elpa] master aaae46b 74/78: M-x copyright-update, Dmitry Gutov, 2018/02/18
- [elpa] master 66e43a3 31/78: Add interactive tags and skip-unless, Dmitry Gutov, 2018/02/18
- [elpa] master cb2ae50 38/78: Don't restart semantics after ::, Dmitry Gutov, 2018/02/18
- [elpa] master 75b4daa 37/78: Merge pull request #737 from iquiw/container-based-ci, Dmitry Gutov, 2018/02/18
- [elpa] master 0f70fee 47/78: Add keywords for swift-mode, Dmitry Gutov, 2018/02/18
- [elpa] master 10807eb 48/78: Merge pull request #750 from jojojames/master, Dmitry Gutov, 2018/02/18
- [elpa] master 556fe45 45/78: Specify type, Dmitry Gutov, 2018/02/18
- [elpa] master e97d26f 51/78: Specify :type for company-dabbrev -ignore-case and -downcase, Dmitry Gutov, 2018/02/18
- [elpa] master d789f26 54/78: Merge pull request #754 from jabranham/fix-defcustom, Dmitry Gutov, 2018/02/18
- [elpa] master 3959af9 52/78: Specify :type for company-semantic-begin-after-member-access, Dmitry Gutov, 2018/02/18
- [elpa] master 7c5408c 57/78: company-clang--start-process: Kill the existing process, if any,
Dmitry Gutov <=
- [elpa] master 0efc9f3 58/78: Reindent, Dmitry Gutov, 2018/02/18
- [elpa] master b22df34 60/78: Use inhibit-redisplay, Dmitry Gutov, 2018/02/18
- [elpa] master 307b620 59/78: Simplify how async backends are called (WIP), Dmitry Gutov, 2018/02/18
- [elpa] master 82d41b7 70/78: Avoid an extra redisplay call, Dmitry Gutov, 2018/02/18
- [elpa] master 4004c7f 42/78: Merge pull request #748 from nikital/tng-dont-require-match, Dmitry Gutov, 2018/02/18
- [elpa] master 6ddeae2 43/78: Rework Clang version handling, Dmitry Gutov, 2018/02/18
- [elpa] master 0bd111d 49/78: Add keywords for kotlin-mode, Dmitry Gutov, 2018/02/18
- [elpa] master f3910a2 71/78: Add a comment justifying the duplication [ci skip], Dmitry Gutov, 2018/02/18
- [elpa] master b079bd2 75/78: Revert "Break idle re-starting loop", Dmitry Gutov, 2018/02/18
- [elpa] master 7cc0901 77/78: Release 0.9.5, Dmitry Gutov, 2018/02/18