[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/git-commit e23846ec2d 1/7: magit-save-repository-buffers:
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/git-commit e23846ec2d 1/7: magit-save-repository-buffers: Cosmetics |
Date: |
Fri, 17 Mar 2023 19:59:47 -0400 (EDT) |
branch: elpa/git-commit
commit e23846ec2d63ae8c3c94292114dca00ad60e0cab
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
magit-save-repository-buffers: Cosmetics
---
lisp/magit-mode.el | 51 +++++++++++++++++++++++++--------------------------
1 file changed, 25 insertions(+), 26 deletions(-)
diff --git a/lisp/magit-mode.el b/lisp/magit-mode.el
index 0b30e1d16c..2b69744069 100644
--- a/lisp/magit-mode.el
+++ b/lisp/magit-mode.el
@@ -1118,32 +1118,31 @@ argument (the prefix) non-nil means save all with no
questions."
"to skip the current buffer and remember choice")
,@save-some-buffers-action-alist)))
(save-some-buffers
- arg (lambda ()
- (and buffer-file-name
- ;; If the current file is modified and resides inside
- ;; a repository, and a let-binding is in effect, which
- ;; places us in another repository, then the below
- ;; let-binding is needed to prevent that file from
- ;; being saved.
- (let ((default-directory
- (file-name-directory buffer-file-name)))
- (and
- ;; - Check whether the repository still exists
- ;; Necessary because we call git inside of it.
- default-directory
- (file-exists-p default-directory)
- ;; - Check whether refreshing is disabled.
- (not magit-inhibit-refresh-save)
- ;; - Check whether the visited file is either on the
- ;; same remote as the repository, or both are on
- ;; the local system.
- (equal (file-remote-p buffer-file-name) remote)
- ;; Delayed checks that are more expensive for remote
- ;; repositories, due to the required network access.
- ;; - Check whether the file is inside the repository.
- (equal (magit-rev-parse-safe "--show-toplevel") topdir)
- ;; - Check whether the file is actually writable.
- (file-writable-p buffer-file-name)))))))))
+ arg
+ (lambda ()
+ ;; If the current file is modified and resides inside
+ ;; a repository, and a let-binding is in effect, which
+ ;; places us in another repository, then this binding
+ ;; is needed to prevent that file from being saved.
+ (and-let* ((default-directory
+ (and buffer-file-name
+ (file-name-directory buffer-file-name))))
+ (and
+ ;; Check whether the repository still exists.
+ (file-exists-p default-directory)
+ ;; Check whether refreshing is disabled.
+ (not magit-inhibit-refresh-save)
+ ;; Check whether the visited file is either on the
+ ;; same remote as the repository, or both are on
+ ;; the local system.
+ (equal (file-remote-p buffer-file-name) remote)
+ ;; Delayed checks that are more expensive for remote
+ ;; repositories, due to the required network access.
+ ;;
+ ;; Check whether the file is inside the repository.
+ (equal (magit-rev-parse-safe "--show-toplevel") topdir)
+ ;; Check whether the file is actually writable.
+ (file-writable-p buffer-file-name))))))))
;;; Restore Window Configuration
- [nongnu] elpa/git-commit updated (eb66aed3b4 -> 564a5ceeb0), ELPA Syncer, 2023/03/17
- [nongnu] elpa/git-commit e23846ec2d 1/7: magit-save-repository-buffers: Cosmetics,
ELPA Syncer <=
- [nongnu] elpa/git-commit 8606488578 2/7: magit-save-repository-buffers: Rev-parse only once per directory, ELPA Syncer, 2023/03/17
- [nongnu] elpa/git-commit e94b6ebfdb 6/7: Record diff-type in magit-diff-mode buffers, ELPA Syncer, 2023/03/17
- [nongnu] elpa/git-commit 564a5ceeb0 7/7: magit-git-debug: Fix key binding in docstring, ELPA Syncer, 2023/03/17
- [nongnu] elpa/git-commit c5c8f79167 4/7: magit-toplevel: Cosmetics, ELPA Syncer, 2023/03/17
- [nongnu] elpa/git-commit ff4710afa6 3/7: Deprecate magit-git-dir to avoid needlessly repeating work, ELPA Syncer, 2023/03/17
- [nongnu] elpa/git-commit 623d335b4d 5/7: Memorize gitdir and topdir for each Magit buffer, ELPA Syncer, 2023/03/17