wakatime-mode icon indicating copy to clipboard operation
wakatime-mode copied to clipboard

org-mode with wakatime-mode

Open ht-hieu opened this issue 6 years ago • 6 comments

Hi all,

I'm an org-mode fan. I usually code in org-mode files (literate programming style). But, sadly, wakatime-mode seem doesn't track my activities (even when I tried org-edit-special). Is there any way to use wakatime-mode with org-mode?

Thank you. 😄

ht-hieu avatar Dec 11 '17 13:12 ht-hieu

This is probably because WakaTime counts coding activity around files, so if there's not a file available on disc then WakaTime doesn't log anything. Can you save an org-mode session to disc somehow?

alanhamlett avatar Dec 11 '17 17:12 alanhamlett

it's a literate programming mode which opens a new buffer with a subset of the original file buffer for editing of a code section.. It probably has some variable one can check to find out which file-buffer it corresponds to.

thomasf avatar Dec 11 '17 17:12 thomasf

Ok.. it does actually present itself as a file-buffer.. evaluating (buffer-file-name (current-buffer)) inside a org-edit-special buffer (C-c ') returns "/home/thomasf/src/dotfiles/notes/org/file.org[*Org Src file.org • dotfiles/notes/org[ example ]*]" which is based on my buffer formatting configuration.

Editing file buffers in org-mode normally seems to be reported just fine for me.

thomasf avatar Dec 11 '17 17:12 thomasf

Hi @thomasf, It can report but it reported as other language instead of a language which is defined in major-mode. My buffer format is: "~/name.org[*Org Src name.org[ major-mode ]*]". Is wakatime-mode uses file name extension to detect language?

ht-hieu avatar Dec 12 '17 01:12 ht-hieu

@gochit WakaTime uses pygments for language detection. It uses a combination of symbols parsed from file contents and the file's extension.

alanhamlett avatar Dec 12 '17 04:12 alanhamlett

Someone suggested recently that we detect when org-mode is enabled, and add argument --language Org to the wakatime-cli call.

alanhamlett avatar Mar 24 '21 05:03 alanhamlett