From: Nikolaj Schumacher Date: Sun, 21 Feb 2010 18:48:10 +0000 (+0100) Subject: Don't auto-save buffers when they haven't been modified. X-Git-Tag: 0.5~16 X-Git-Url: https://rtime.felk.cvut.cz/gitweb/sojka/company-mode.git/commitdiff_plain/bef5252724d2da5345c18a3107606103cb011f90 Don't auto-save buffers when they haven't been modified. --- 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)