diff options
author | Óscar Nájera <hi@oscarnajera.com> | 2022-09-28 13:21:53 +0200 |
---|---|---|
committer | Óscar Nájera <hi@oscarnajera.com> | 2022-09-28 13:21:53 +0200 |
commit | 1b42e43e708ff6539da7b3a0ed11d4b7c54975f4 (patch) | |
tree | 4637c352bb96c7d528455e3c914a3a7907e3aa9c /elisp | |
parent | a1cbc3ac8d66b01d7b356316e9713987b21d258c (diff) | |
download | dotfiles-1b42e43e708ff6539da7b3a0ed11d4b7c54975f4.tar.gz dotfiles-1b42e43e708ff6539da7b3a0ed11d4b7c54975f4.tar.bz2 dotfiles-1b42e43e708ff6539da7b3a0ed11d4b7c54975f4.zip |
journal function to end
Diffstat (limited to 'elisp')
-rw-r--r-- | elisp/journalctl.el | 30 |
1 files changed, 15 insertions, 15 deletions
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." |