branch: externals/detached commit 7c5952ad8849b09bb3f0073a637af17466ac412a Author: Niklas Eklund <niklas.ekl...@posteo.net> Commit: Niklas Eklund <niklas.ekl...@posteo.net>
Add refresh session log command for log-mode --- detached.el | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/detached.el b/detached.el index c8cabfaf7f..5cbac665df 100644 --- a/detached.el +++ b/detached.el @@ -463,6 +463,20 @@ Optionally DELETE the session if prefix-argument is provided." (pop-to-buffer buffer-name)) (message "Detached can't find file: %s" file-path))))) +;;;###autoload +(defun detached-refresh-session-log () + "Refresh log content of session in current buffer." + (interactive) + (let* ((session detached--buffer-session) + (inhibit-read-only t)) + (if (not (eq 'active (detached--session-state session))) + (message "Session is inactive") + (erase-buffer) + (insert (detached--session-output session)) + (detached-log-mode) + (setq detached--buffer-session session) + (goto-char (point-max))))) + ;;;###autoload (defun detached-diff-session (session1 session2) "Diff SESSION1 with SESSION2." @@ -1409,8 +1423,7 @@ If event is cased by an update to the `detached' database, re-initialize (defvar detached-log-mode-map (let ((map (make-sparse-keymap))) (define-key map (kbd detached-detach-key) #'detached-detach-session) - ;; TODO(Niklas Eklund, 20220530): Add refresh command (g), good - ;; for manual tailing + (define-key map (kbd "C-c C-l") #'detached-refresh-session-log) map) "Keymap for `detached-log-mode'.")