branch: elpa/magit
commit d81e6df443d9f8f0cc12f4063a3aebafb25d4e05
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>

    magit-status-here: Also save file-visiting buffers
---
 docs/magit.org       | 3 +++
 docs/magit.texi      | 3 +++
 lisp/magit-status.el | 6 +++++-
 3 files changed, 11 insertions(+), 1 deletion(-)

diff --git a/docs/magit.org b/docs/magit.org
index 95b981f5276..15db800708c 100644
--- a/docs/magit.org
+++ b/docs/magit.org
@@ -8043,6 +8043,9 @@ all, add this to your init file and restart Emacs.
   the position in that buffer, which corresponds to the position
   in the current file-visiting buffer (if any).
 
+  Before doing so, save all file-visiting buffers belonging to the
+  current repository without prompting.
+
 - Key: C-c M-g G (magit-display-repository-buffer) ::
 
   This command reads and displays a Magit buffer belonging to the
diff --git a/docs/magit.texi b/docs/magit.texi
index 3e3f92a370a..b3c7b870d0c 100644
--- a/docs/magit.texi
+++ b/docs/magit.texi
@@ -9717,6 +9717,9 @@ buffer, like @code{magit-status} does.  Additionally it 
tries to go to
 the position in that buffer, which corresponds to the position
 in the current file-visiting buffer (if any).
 
+Before doing so, save all file-visiting buffers belonging to the
+current repository without prompting.
+
 @item @kbd{C-c M-g G} (@code{magit-display-repository-buffer})
 @kindex C-c M-g G
 @findex magit-display-repository-buffer
diff --git a/lisp/magit-status.el b/lisp/magit-status.el
index ca99dcdbc07..715fc583214 100644
--- a/lisp/magit-status.el
+++ b/lisp/magit-status.el
@@ -346,8 +346,12 @@ also contains other useful hints.")
 
 ;;;###autoload
 (defun magit-status-here ()
-  "Like `magit-status' but with non-nil `magit-status-goto-file-position'."
+  "Like `magit-status' but with non-nil `magit-status-goto-file-position'.
+Before doing so, save all file-visiting buffers belonging to the current
+repository without prompting."
   (interactive)
+  (let ((magit-inhibit-refresh t))
+    (magit-save-repository-buffers t))
   (let ((magit-status-goto-file-position t))
     (call-interactively #'magit-status)))
 

Reply via email to