aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej Barć <xgqt@gentoo.org>2023-02-03 19:31:09 +0100
committerMaciej Barć <xgqt@gentoo.org>2023-02-03 19:31:09 +0100
commit4a4bfccb9bb99bcd77e5423ff6df5c5bfc56f35e (patch)
treeee0366b3def6502699edc8a9a24c0e58a9e5a1d6
parentelogt.el: elogt-open-entry improvements (diff)
downloademacs-elogt-4a4bfccb9bb99bcd77e5423ff6df5c5bfc56f35e.tar.gz
emacs-elogt-4a4bfccb9bb99bcd77e5423ff6df5c5bfc56f35e.tar.bz2
emacs-elogt-4a4bfccb9bb99bcd77e5423ff6df5c5bfc56f35e.zip
elogt.el: implement elogt-delete-entry
Signed-off-by: Maciej Barć <xgqt@gentoo.org>
-rw-r--r--elogt.el15
1 files changed, 9 insertions, 6 deletions
diff --git a/elogt.el b/elogt.el
index 724e973..4b98360 100644
--- a/elogt.el
+++ b/elogt.el
@@ -129,15 +129,15 @@ A logfile priority level is one of: None, Info, Warn, Error."
(aref table-entry 2)
(aref table-entry 3)))
-(defun elogt--get-tabe-logfile-path ()
+(defun elogt--get-table-entry-logfile-path ()
"Return a logfile path of current ElogT table entry."
(elogt--entry-logfile-path (tabulated-list-get-entry)))
(defun elogt--open-entry-file ()
- "Open specified ElogT table entry.
+ "Open a ElogT table entry at point.
Return opened buffer (done via `find-file')."
- (find-file (elogt--get-tabe-logfile-path)))
+ (find-file (elogt--get-table-entry-logfile-path)))
(defun elogt-open-entry ()
"Open specified ElogT table entry and put it in a mode for viewing only."
@@ -147,12 +147,15 @@ Return opened buffer (done via `find-file')."
(fundamental-mode)
(view-mode))))
+(defun elogt--delete-entry-file ()
+ "Delete a logfile of a entry at point."
+ (delete-file (elogt--get-table-entry-logfile-path)))
+
(defun elogt-delete-entry ()
"Delete specified ElogT table entry."
(interactive)
-
- ;; TODO: Implement.
- nil)
+ (elogt--delete-entry-file)
+ (tabulated-list-delete-entry))
(defun elogt-refresh-table ()
"Refresh the ElogT table."