chiark / gitweb /
el/dot-emacs.el: Don't prompt to save other buffers on WIP save.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 9 Aug 2017 09:55:55 +0000 (10:55 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 9 Aug 2017 09:59:54 +0000 (10:59 +0100)
I have `magit-wip-after-save-mode' on, to save my changes into a magic
Git branch while I'm working.  This stimulates a commit on each save,
and Magit is assiduous in asking whether I want to save other buffers
visiting files tracked by the project.  I don't -- and the confirmation
prompt discombobulates me every time it appears.  Tell it this by
advising `magit-wip-commit-buffer-file' appropriately.

el/dot-emacs.el

index c24d9ec0e82d370bb4c544a9757bb19e88b74d0b..5314fd90cbdd5e0f761814bd1cfb010e3dd52a8b 100644 (file)
@@ -3929,6 +3929,10 @@ (eval-after-load "magit"
                           magit-revision-mode-refresh-popup))
            (magit-define-popup-switch popup ?R "Reverse diff" "-R"))))
 
+(defadvice magit-wip-commit-buffer-file
+    (around mdw-just-this-buffer activate compile)
+  (let ((magit-save-repository-buffers nil)) ad-do-it))
+
 (setq magit-repolist-columns
       '(("Name" 16 magit-repolist-column-ident nil)
        ("Version" 18 magit-repolist-column-version nil)