<div dir="ltr">Hi list,<div><br></div><div>I added this to my .emacs to clang-format C++ buffers before they are saved:</div><div><br></div><div><div>; on-save: clang-format</div><div>(add-hook 'c++-mode-hook</div><div>    (lambda()</div><div>        (add-hook 'before-save-hook 'clang-format-buffer)))</div></div><div><br></div><div>This is fine if I save an individual buffer with "C-x C-s", but if I do "C-x s" (save-some-buffers), the buffer is clang-formatted (as expected) but sadly I lose my place in the buffer (window-start is moved to the beginning, and the point is moved to beginning-of-line about halfway down the window).  Does anyone know what's going on with that?  I'm not much good with elisp, but so far I've overcome that deficit enough to understand most of clang-format.el.  Unfortunately, I haven't identified the problem yet.  I'm prepared to spend some more time on this tomorrow, and if I come up with any improvement to clang-format.el I'll share it of course.  Any clue you may have would be much appreciated.</div><div><br></div><div>Thanks!</div><div><br></div></div>