From: Dmitry Gutov Date: Sun, 21 Jun 2015 18:53:57 +0000 (+0300) Subject: company-clang--start-process: Only erase buffer when there's no existing process X-Git-Url: https://code.delx.au/gnu-emacs-elpa/commitdiff_plain/b0a946db2c40c4cdba58d4a61b42468db7823ba5 company-clang--start-process: Only erase buffer when there's no existing process Fixes #368 --- 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