From bef5252724d2da5345c18a3107606103cb011f90 Mon Sep 17 00:00:00 2001 From: Nikolaj Schumacher Date: Sun, 21 Feb 2010 19:48:10 +0100 Subject: [PATCH] Don't auto-save buffers when they haven't been modified. --- company-clang.el | 5 +++-- company-eclim.el | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/company-clang.el b/company-clang.el index 855dc94..88f0f6f 100644 --- a/company-clang.el +++ b/company-clang.el @@ -154,8 +154,9 @@ Prefix files (-include ...) can be selected with (list buffer-file-name))) (defun company-clang--candidates (prefix) - (when company-clang-auto-save - (save-buffer)) + (and company-clang-auto-save + (buffer-modified-p) + (save-buffer)) (when (null company-clang--prefix) (company-clang-set-prefix (or (funcall company-clang-prefix-guesser) 'none))) diff --git a/company-eclim.el b/company-eclim.el index 9f5c507..0441b5c 100644 --- a/company-eclim.el +++ b/company-eclim.el @@ -97,7 +97,8 @@ eclim can only complete correctly when the buffer has been saved." (company-eclim--project-dir))) (project-name (company-eclim--project-name))) (when company-eclim-auto-save - (save-buffer) + (when (buffer-modified-p) + (save-buffer)) ;; FIXME: Sometimes this isn't finished when we complete. (company-eclim--call-process "java_src_update" "-p" (company-eclim--project-name) -- 2.39.2