From 1b42e43e708ff6539da7b3a0ed11d4b7c54975f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=93scar=20N=C3=A1jera?= Date: Wed, 28 Sep 2022 13:21:53 +0200 Subject: journal function to end --- elisp/journalctl.el | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'elisp') diff --git a/elisp/journalctl.el b/elisp/journalctl.el index f36ebc1..c95c564 100644 --- a/elisp/journalctl.el +++ b/elisp/journalctl.el @@ -148,21 +148,6 @@ It seems I must kill the buffer for tramp to behave correctly on the new calls." (delq nil) (completing-read "Unit: "))))) -(defun journalctl (host options) - "Query the log of HOST given OPTIONS." - (interactive - (let* ((picked-host (completing-read "Tramp host: " journalctl-hosts)) - (default-options `(("--unit" ,(journalctl-system-units picked-host)) ("--follow")))) - (list picked-host default-options))) - (let ((buffer (journalctl--clean-buffer)) - (default-directory host)) - (apply #'start-file-process "Journal" buffer "journalctl" (flatten-tree options)) - (with-current-buffer buffer - (journalctl-mode) - (setq-local journalctl-current-host host) - (setq-local journalctl-current-opts options)) - (switch-to-buffer buffer))) - (defun journalctl-remove-opt (opt) "Remove an OPT flag from the journal query." (interactive (list (completing-read "remove option" (mapcar #'car journalctl-current-opts) nil t))) @@ -219,6 +204,21 @@ If OPT is set, remove this option." map) "Keymap for journalctl mode.") +(defun journalctl (host options) + "Query the log of HOST given OPTIONS." + (interactive + (let* ((picked-host (completing-read "Tramp host: " journalctl-hosts)) + (default-options `(("--unit" ,(journalctl-system-units picked-host)) ("--follow")))) + (list picked-host default-options))) + (let ((buffer (journalctl--clean-buffer)) + (default-directory host)) + (apply #'start-file-process "Journal" buffer "journalctl" (flatten-tree options)) + (with-current-buffer buffer + (journalctl-mode) + (setq-local journalctl-current-host host) + (setq-local journalctl-current-opts options)) + (switch-to-buffer buffer))) + ;;;###autoload (define-derived-mode journalctl-mode fundamental-mode "journalctl" "Major mode for viewing journalctl output." -- cgit v1.2.3