aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--elogt.el21
1 files changed, 17 insertions, 4 deletions
diff --git a/elogt.el b/elogt.el
index db51cc0..46ea319 100644
--- a/elogt.el
+++ b/elogt.el
@@ -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."