Skip to content

Commit

Permalink
Move todos, fix readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Artawower committed Sep 6, 2021
1 parent f76ee8b commit f489362
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.org
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ Now /turbo-log/ is not available from MELPA. Your can install it with quelpa or
+ [X] Golang support
+ [ ] Improve insert position finding
+ [X] Comment/uncomment all log messages that were made by package.
+ [ ] Remove all log messages that were made by package.
+ [X] Remove all log messages that were made by package.
8 changes: 1 addition & 7 deletions turbo-log.el
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ Insert LINE-NUMBER and buffer name."
(code (replace-regexp-in-string "\\:[[:blank:]].+" "" code)))
(turbo-log--remove-semicolon-at-end code)))

;; TODO: adapt for ecmascript
(defun turbo-log--ecmascript-find-insert-pos (current-line-number text)
"Calculate insert position by CURRENT-LINE-NUMBER and TEXT from previous line."
(if (turbo-log--return-line-p text)
Expand Down Expand Up @@ -138,7 +137,6 @@ PREV-LINE-TEXT - text from previous line"
(goto-line insert-line-number)
(insert turbo-log--message)))

;; TODO: adapt for python
(defun turbo-log--python-find-insert-pos (current-line-number text)
"Find insert position for python mode from CURRENT-LINE-NUMBER TEXT."
(if (turbo-log--return-line-p text)
Expand All @@ -153,13 +151,12 @@ PREV-LINE-TEXT - text from previous line"
code))

(defun turbo-log--python-normalize-code (code)
"Normalize python CODE for correct printing."
"Normalize python CODE for correct logging."
(let* ((code (if (string-match "def[[:blank:]]" code) (turbo-log--extract-python-args code)
(replace-regexp-in-string "[[:blank:]]*=[[:blank:]]*.+" "" code))))
code))

;; Python logger
;; TODO: remove prev-line-text, it will be useless after correct position detection.
(defun turbo-log--python-print (current-line-number formatted-selected-text prev-line-text)
"Printing for python mode.
Expand All @@ -168,8 +165,6 @@ FORMATTED-SELECTED-TEXT - formatted text without space at start position
PREV-LINE-TEXT - text from previous line"

(let* ((insert-line-number (turbo-log--python-find-insert-pos current-line-number prev-line-text))
;; TODO: add forward/backward search for first symbol for correct tab indenting. Check direction of searching
;; by special keywoard if/for/while/def (fo forward) return for backward
(insert-line-space-count (turbo-log--calculate-space-count (turbo-log--get-line-text (- insert-line-number 1))))
(additional-spaces (make-string insert-line-space-count ? ))
(meta-info (turbo-log--format-meta-info current-line-number))
Expand All @@ -189,7 +184,6 @@ PREV-LINE-TEXT - text from previous line"
(insert turbo-log--message)))

;; Golang logger
;; TODO: adapt for golang
(defun turbo-log--golang-find-insert-pos (current-line-number text)
"Find insert position for python mode from CURRENT-LINE-NUMBER and provided TEXT."
(if (turbo-log--return-line-p text)
Expand Down

0 comments on commit f489362

Please sign in to comment.