[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/git-commit 85d0554f4f 1/2: Optionally display process star
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/git-commit 85d0554f4f 1/2: Optionally display process start time in margin of process buffers |
Date: |
Sun, 23 Apr 2023 09:03:47 -0400 (EDT) |
branch: elpa/git-commit
commit 85d0554f4f8f219e5e7aaa02e44c65a1eae01b30
Author: Jonas Bernoulli <jonas@bernoul.li>
Commit: Jonas Bernoulli <jonas@bernoul.li>
Optionally display process start time in margin of process buffers
Closes #4920.
---
lisp/magit-margin.el | 1 +
lisp/magit-process.el | 25 ++++++++++++++++++++++++-
2 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/lisp/magit-margin.el b/lisp/magit-margin.el
index 20688b43d4..bca5390877 100644
--- a/lisp/magit-margin.el
+++ b/lisp/magit-margin.el
@@ -114,6 +114,7 @@ does not carry to other options."
('magit-cherry-mode 'magit-cherry-margin)
('magit-log-mode 'magit-log-margin)
('magit-log-select-mode 'magit-log-select-margin)
+ ('magit-process-mode 'magit-process-margin)
('magit-reflog-mode 'magit-reflog-margin)
('magit-refs-mode 'magit-refs-margin)
('magit-stashes-mode 'magit-stashes-margin)
diff --git a/lisp/magit-process.el b/lisp/magit-process.el
index e51297de62..626e7acafc 100644
--- a/lisp/magit-process.el
+++ b/lisp/magit-process.el
@@ -245,6 +245,25 @@ implement such functions."
:group 'magit-process
:type 'boolean)
+(defcustom magit-process-margin '(nil "%H:%M:%S" 8)
+ "Format of the margin in `magit-process-mode' buffers.
+
+When this is enabled, the start time of the process is
+displayed in the margin.
+
+The value has the form (INIT TIME-FORMAT WIDTH). If INIT is
+non-nil, then the margin is shown initially. TIME-FORMAT is
+a string suitable for `format-time-string', and WIDTH should
+be the number of characters needed to display the string that
+that function returns for TIME-FORMAT."
+ :package-version '(magit . "4.0.0")
+ :group 'magit-process
+ :group 'magit-margin
+ :set (apply-partially #'magit-margin-set-variable 'magit-process-mode)
+ :type '(list (boolean :tag "Show margin initially")
+ (string :tag "Time format string")
+ (number :tag "Time format string width")))
+
(defface magit-process-ok
'((t :inherit magit-section-heading :foreground "green"))
"Face for zero exit-status."
@@ -272,7 +291,8 @@ Used when `magit-process-display-mode-line-error' is
non-nil."
(defvar-keymap magit-process-mode-map
:doc "Keymap for `magit-process-mode'."
:parent magit-mode-map
- "<remap> <magit-delete-thing>" #'magit-process-kill)
+ "<remap> <magit-delete-thing>" #'magit-process-kill
+ "L" #'magit-toggle-margin)
(define-derived-mode magit-process-mode magit-mode "Magit Process"
"Mode for looking at Git process output."
@@ -306,6 +326,7 @@ optional NODISPLAY is non-nil also display it."
(when magit-process-log-max
(magit-process-truncate-log))
(magit-process-mode)
+ (magit-set-buffer-margin)
(let ((inhibit-read-only t)
(magit-insert-section--parent nil)
(magit-insert-section--oldroot nil))
@@ -650,6 +671,8 @@ Magit status buffer."
(insert (file-relative-name pwd default-directory) ?\s))
(insert (magit-process--format-arguments program args))
(magit-insert-heading)
+ (magit-make-margin-overlay
+ (format-time-string (cadr magit-buffer-margin)) t)
(when errlog
(if (bufferp errlog)
(insert (with-current-buffer errlog