0

I am looking towards tracking the number of lines of text that I have added or removed in a session of emacs, is there any simple way to do this?

If not what would be the right direction towards writing a plugin that would help me do this?

  • Do you just want the net added or removed, without needing to know how many were added vs how many removed in the same session? Do you need this for all buffers together or individually? The question is unclear. Anyway, you can use function count-lines at point-max anytime to get the number of lines in a given buffer. There is also count-lines-region. – Drew Dec 21 '17 at 4:43
  • 2
    Count of lines added, and count of lines removed separately. It should be in one session - inclusive of all buffers. – Prathik Rajendran M Dec 21 '17 at 7:24
  • Please don't clarify your question in a comment. Comments can be deleted at any time. Please clarify the question itself. – Drew Dec 21 '17 at 16:19
1

I solved it for a project by creating a function

(defun show-code-delta ()
   (message (shell-command-to-string "git diff --shortstat")))

I bound this to C-c C-c

Whenever I do a C-c C-c I get to know the lines changed from the last commit and it gives me a rough idea of how many changes I have done in a session.

-1

If you're using git, you might like to look at git-gutter mode: https://github.com/jisaacks/GitGutter

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.