branch: elpa/magit
commit 62534ba292255a7516ccaf8ecd59449ee462f403
Author: Jonas Bernoulli <[email protected]>
Commit: Jonas Bernoulli <[email protected]>
magit-set-{buffer,window}-margins: Rename to make plural
In the next commit we'll start using the left margin as well.
---
lisp/magit-log.el | 2 +-
lisp/magit-margin.el | 18 +++++++++---------
lisp/magit-mode.el | 4 ++--
3 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/lisp/magit-log.el b/lisp/magit-log.el
index 7250443f87b..e26c7bb6d08 100644
--- a/lisp/magit-log.el
+++ b/lisp/magit-log.el
@@ -1617,7 +1617,7 @@ The shortstat style is experimental and rather slow."
(interactive)
(setq magit-log-margin-show-shortstat
(not magit-log-margin-show-shortstat))
- (magit-set-buffer-margin nil t))
+ (magit-set-buffer-margins nil t))
(defun magit-log-format-margin (rev author date)
(when (magit--right-margin-option)
diff --git a/lisp/magit-margin.el b/lisp/magit-margin.el
index 4b903e6852f..1771fee93c4 100644
--- a/lisp/magit-margin.el
+++ b/lisp/magit-margin.el
@@ -91,7 +91,7 @@ does not carry to other options."
(unless (magit--right-margin-option)
(user-error "Magit margin isn't supported in this buffer"))
(setcar magit--right-margin-config (not (magit--right-margin-active)))
- (magit-set-buffer-margin))
+ (magit-set-buffer-margins))
(defvar magit-margin-default-time-format nil
"See https://github.com/magit/magit/pull/4605.")
@@ -113,7 +113,7 @@ does not carry to other options."
(cadr (symbol-value
(magit--right-margin-option))))))
(if (stringp default) default "%Y-%m-%d %H:%M ")))
(_ 'age)))
- (magit-set-buffer-margin nil t))
+ (magit-set-buffer-margins nil t))
(transient-define-suffix magit-toggle-margin-details ()
"Show or hide details in the right margin."
@@ -125,11 +125,11 @@ does not carry to other options."
(user-error "Magit margin isn't supported in this buffer"))
(setf (nth 3 magit--right-margin-config)
(not (nth 3 magit--right-margin-config)))
- (magit-set-buffer-margin nil t))
+ (magit-set-buffer-margins nil t))
;;; Core
-(defun magit-set-buffer-margin (&optional reset refresh)
+(defun magit-set-buffer-margins (&optional reset refresh)
(when-let ((option (magit--right-margin-option)))
(let* ((default (symbol-value option))
(default-width (nth 2 default)))
@@ -142,16 +142,16 @@ does not carry to other options."
(funcall default-width style details details-width)))
(dolist (window (get-buffer-window-list nil nil 0))
(with-selected-window window
- (magit-set-window-margin window)
+ (magit-set-window-margins window)
(if enable
(add-hook 'window-configuration-change-hook
- #'magit-set-window-margin nil t)
+ #'magit-set-window-margins nil t)
(remove-hook 'window-configuration-change-hook
- #'magit-set-window-margin t))))
+ #'magit-set-window-margins t))))
(when (and enable (or refresh magit--right-margin-delayed))
(magit-refresh-buffer))))))
-(defun magit-set-window-margin (&optional window)
+(defun magit-set-window-margins (&optional window)
(when (or window (setq window (get-buffer-window)))
(with-selected-window window
(set-window-margins
@@ -195,7 +195,7 @@ line is affected."
(dolist (buffer (buffer-list))
(with-current-buffer buffer
(when (eq major-mode mode)
- (magit-set-buffer-margin t)
+ (magit-set-buffer-margins t)
(magit-refresh))))
(message "Updating margins in %s buffers...done" mode))
diff --git a/lisp/magit-mode.el b/lisp/magit-mode.el
index f52fb17454c..d7b189d8597 100644
--- a/lisp/magit-mode.el
+++ b/lisp/magit-mode.el
@@ -64,7 +64,7 @@
(defcustom magit-setup-buffer-hook
(list #'magit-maybe-save-repository-buffers
- 'magit-set-buffer-margin) ; from magit-margin.el
+ 'magit-set-buffer-margins) ; from magit-margin.el
"Hook run by `magit-setup-buffer'.
This is run right after displaying the buffer and right before
@@ -76,7 +76,7 @@ should be used instead of this one."
:group 'magit-modes
:type 'hook
:options (list #'magit-maybe-save-repository-buffers
- 'magit-set-buffer-margin))
+ 'magit-set-buffer-margins))
(defcustom magit-pre-refresh-hook
(list #'magit-maybe-save-repository-buffers)