diff options
author | 2023-02-03 19:16:22 +0100 | |
---|---|---|
committer | 2023-02-03 19:16:22 +0100 | |
commit | 4812edd842565d31dd8f7376fe931d4edaed2cee (patch) | |
tree | 7fc6dd020dec83d36f5ad4bd2831adf3f24bac2c | |
parent | elogt.el: message on refreshes (diff) | |
download | emacs-elogt-4812edd842565d31dd8f7376fe931d4edaed2cee.tar.gz emacs-elogt-4812edd842565d31dd8f7376fe931d4edaed2cee.tar.bz2 emacs-elogt-4812edd842565d31dd8f7376fe931d4edaed2cee.zip |
elogt.el: implement elogt-open-entry
Signed-off-by: Maciej Barć <xgqt@gentoo.org>
-rw-r--r-- | elogt.el | 21 |
1 files changed, 17 insertions, 4 deletions
@@ -121,12 +121,25 @@ A logfile priority level is one of: None, Info, Warn, Error." ;; Table interaction -(defun elogt-open-entry () +(defun elogt--entry-logfile-path (table-entry) + "Return a logfile path of a ElogT TABLE-ENTRY entry." + (format "%s/%s:%s:%s.log" + elogt-portage-log-dir + (aref table-entry 1) + (aref table-entry 2) + (aref table-entry 3))) + +(defun elogt--open-entry-file () "Open specified ElogT table entry." - (interactive) + (find-file (elogt--entry-logfile-path (tabulated-list-get-entry)))) - ;; TODO: Implement. - nil) +(defun elogt-open-entry () + "Open specified ElogT table entry and put it in a mode for viewing only." + (interactive) + (let ((buffer (elogt--open-entry-file))) + (with-current-buffer buffer + (fundamental-mode) + (view-mode)))) (defun elogt-delete-entry () "Delete specified ElogT table entry." |