From b0a946db2c40c4cdba58d4a61b42468db7823ba5 Mon Sep 17 00:00:00 2001 From: Dmitry Gutov Date: Sun, 21 Jun 2015 21:53:57 +0300 Subject: [PATCH] company-clang--start-process: Only erase buffer when there's no existing process Fixes #368 --- company-clang.el | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/company-clang.el b/company-clang.el index d0e2b84b8..369f4a908 100644 --- a/company-clang.el +++ b/company-clang.el @@ -203,11 +203,11 @@ or automatically through a custom `company-clang-prefix-guesser'." (buf (get-buffer-create "*clang-output*")) ;; Looks unnecessary in Emacs 25.1 and later. (process-adaptive-read-buffering nil)) - (with-current-buffer buf - (erase-buffer) - (setq buffer-undo-list t)) (if (get-buffer-process buf) (funcall callback nil) + (with-current-buffer buf + (erase-buffer) + (setq buffer-undo-list t)) (let ((process (apply #'start-process "company-clang" buf company-clang-executable args))) (set-process-sentinel -- 2.39.2