* [PATCH] process buffer: Add time to header
@ 2020-11-27 20:58 Kyle Meyer
2020-12-09 0:32 ` [PATCH] process buffer: Restore header's leading newline Kyle Meyer
0 siblings, 1 reply; 2+ messages in thread
From: Kyle Meyer @ 2020-11-27 20:58 UTC (permalink / raw)
To: piem
Recording the time makes it easier to digest and group the subprocess
commands when inspecting the buffer later.
---
piem.el | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/piem.el b/piem.el
index 9db9a0c..addc27e 100644
--- a/piem.el
+++ b/piem.el
@@ -195,7 +195,8 @@ (defcustom piem-after-mail-injection-functions nil
(defvar piem-process-mode-font-lock-keywords
`((,(rx line-start
- ";;; " (or "process" "directory") ":" (one-or-more not-newline)
+ ";;; " (or "process" "directory" "time")
+ ":" (one-or-more not-newline)
line-end)
(0 font-lock-comment-face t))
(,(rx line-start
@@ -231,10 +232,14 @@ (defun piem--process-go (dir program program-args fn)
(goto-char (point-max))
(display-buffer buffer)
(let ((inhibit-read-only t))
- (insert (format "\n%s\n;;; process: %S\n;;; directory: %s\n"
+ (insert (format (concat "%s\n"
+ ";;; process: %S\n"
+ ";;; directory: %s\n"
+ ";;; time: %s\n")
(char-to-string 12) ; form feed
(cons program program-args)
- default-directory))
+ default-directory
+ (format-time-string "%FT%T%z")))
(funcall fn)))))
(defun piem-process-start (dir program &rest program-args)
base-commit: c936086abd17576b708e5d654a24d78f9eaf9a4a
--
2.29.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] process buffer: Restore header's leading newline
2020-11-27 20:58 [PATCH] process buffer: Add time to header Kyle Meyer
@ 2020-12-09 0:32 ` Kyle Meyer
0 siblings, 0 replies; 2+ messages in thread
From: Kyle Meyer @ 2020-12-09 0:32 UTC (permalink / raw)
To: piem
Kyle Meyer writes:
> @@ -231,10 +232,14 @@ (defun piem--process-go (dir program program-args fn)
> (goto-char (point-max))
> (display-buffer buffer)
> (let ((inhibit-read-only t))
> - (insert (format "\n%s\n;;; process: %S\n;;; directory: %s\n"
> + (insert (format (concat "%s\n"
> + ";;; process: %S\n"
I should've taken a closer look before applying. This lost a newline.
-- >8 --
Subject: [PATCH] process buffer: Restore header's leading newline
94d0281 (process buffer: Add time to header, 2020-11-27) was just
supposed to add a "time:" field, but it also dropped the leading "\n".
Add it back, and also avoid the unnecessary concat call.
---
piem.el | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/piem.el b/piem.el
index addc27e..0ee4ca6 100644
--- a/piem.el
+++ b/piem.el
@@ -232,10 +232,12 @@ (defun piem--process-go (dir program program-args fn)
(goto-char (point-max))
(display-buffer buffer)
(let ((inhibit-read-only t))
- (insert (format (concat "%s\n"
- ";;; process: %S\n"
- ";;; directory: %s\n"
- ";;; time: %s\n")
+ (insert (format "
+%s
+;;; process: %S
+;;; directory: %s
+;;; time: %s
+"
(char-to-string 12) ; form feed
(cons program program-args)
default-directory
base-commit: 94d028164dc6e9e94a2761af86d6a38e2873296d
--
2.29.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-12-09 0:31 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-27 20:58 [PATCH] process buffer: Add time to header Kyle Meyer
2020-12-09 0:32 ` [PATCH] process buffer: Restore header's leading newline Kyle Meyer
Code repositories for project(s) associated with this public inbox
https://git.kyleam.com/piem/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).