Code Monkey home page Code Monkey logo

habitrpg.el's People

Contributors

ryjm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

habitrpg.el's Issues

File error: Cannot open load file, habitrpg

I'm getting the error File error: Cannot open load file, habitrpg

This is how my config looks like:

(add-to-list 'load-path "~/.emacs.d/personal/elisp/habitrpg/habitrpg.el")
(require 'habitrpg)

(add-hook 'org-after-todo-state-change-hook 'habitrpg-add 'append)
;; For adding tasks from org mode
(global-set-key (kbd "C-c C-x h") 'habitrpg-add)
;; Status buffer - use C-h m to see the keybindings
;; C-c C-c - upvote task or buy reward
;; C-c C-d - downvote task
;; t - bring up manage menu, which adds or deletes tasks
(global-set-key (kbd "<f9> a") 'habitrpg-status)
;; Continuously update a habit attache to a clocking task
(add-hook 'org-clock-in-hook 'habitrpg-clock-in)
(add-hook 'org-clock-out-hook 'habitrpg-clock-out)
;; List of habits to check for when clocking a task
(add-to-list 'hrpg-tags-list "PROGRAMMING")
(add-to-list 'hrpg-tags-list "WORK")
(setq habitrpg-api-user "c873af22-f475-4df0-8d77-e181086b75f8")
(setq habitrpg-api-token "f4186108-ba57-4671-b66b-b79c36c61db4")

Strangely when I do M-x eval-buffer in habitrpg.el I get a eval-buffer: Cannot open load file: habitrpg-key-mode. If I then do a M-x eval-buffer in habitrpg-key-mode.el and then do it again in habitrpg.el and then finally in my config everything seems to work. What do you think could be going on? Thanks!

P.S. This is my emacs config: https://github.com/climatewarrior/dotfiles/tree/master/.emacs.d

Error on habitrpg-add for dailies: void-function org-habit-done-dates

I keep getting a void-function error when I try to add a daily to habitrpg using the default setup (which worked great!). I have tagged the headline with "hrpgdaily", and tried it with and without (repeating) scheduled dates. It seems likely this issue is on my end, and not with the org extension, but any help would be greatly appreciated. Here's a backtrace:

Debugger entered--Lisp error: (void-function org-habit-done-dates)
(org-habit-done-dates (org-habit-parse-todo))
(sort (org-habit-done-dates (org-habit-parse-todo)) (quote >))
(car (sort (org-habit-done-dates (org-habit-parse-todo)) (quote >)))
(days-to-time (car (sort (org-habit-done-dates (org-habit-parse-todo)) (quote >))))
(decode-time (days-to-time (car (sort (org-habit-done-dates (org-habit-parse-todo)) (quote >)))))
(nthcdr 3 (decode-time (days-to-time (car (sort (org-habit-done-dates (org-habit-parse-todo)) (quote >))))))
(butlast (nthcdr 3 (decode-time (days-to-time (car (sort (org-habit-done-dates (org-habit-parse-todo)) (quote >)))))) 4)
(if (member "hrpgdaily" (org-get-tags-at)) (butlast (nthcdr 3 (decode-time (days-to-time (car (sort (org-habit-done-dates ...) (quote >)))))) 4))
(set v (if (member "hrpgdaily" (org-get-tags-at)) (butlast (nthcdr 3 (decode-time (days-to-time (car (sort ... ...))))) 4)))
(let* ((v --cl-last-done-day--)) (set v (if (member "hrpgdaily" (org-get-tags-at)) (butlast (nthcdr 3 (decode-time (days-to-time (car ...)))) 4))))
(let ((--cl-last-done-day-- (make-symbol "--last-done-day--"))) (let* ((v --cl-last-done-day--)) (set v (if (member "hrpgdaily" (org-get-tags-at)) (butlast (nthcdr 3 (decode-time (days-to-time ...))) 4)))) (progn (let ((--cl-type-- (make-symbol "--type--"))) (let* ((v --cl-type--)) (set v nil)) (progn (habitrpg-get-id (symbol-value --cl-task--) (list (quote lambda) (quote (&rest --cl-rest--)) (list (quote apply) (list ... ...) (list ... --cl-type--) (list ... --cl-last-done-day--) (list ... --cl-in-habit--) (list ... --cl-state--) (list ... --cl-task--) (quote --cl-rest--))))))))
(progn (let ((--cl-last-done-day-- (make-symbol "--last-done-day--"))) (let* ((v --cl-last-done-day--)) (set v (if (member "hrpgdaily" (org-get-tags-at)) (butlast (nthcdr 3 (decode-time ...)) 4)))) (progn (let ((--cl-type-- (make-symbol "--type--"))) (let* ((v --cl-type--)) (set v nil)) (progn (habitrpg-get-id (symbol-value --cl-task--) (list (quote lambda) (quote ...) (list ... ... ... ... ... ... ... ...))))))))
(let ((--cl-in-habit-- (make-symbol "--in-habit--"))) (let* ((v --cl-in-habit--)) (set v (org-entry-get-with-inheritance "IN_HABITRPG"))) (progn (let ((--cl-last-done-day-- (make-symbol "--last-done-day--"))) (let* ((v --cl-last-done-day--)) (set v (if (member "hrpgdaily" (org-get-tags-at)) (butlast (nthcdr 3 ...) 4)))) (progn (let ((--cl-type-- (make-symbol "--type--"))) (let* ((v --cl-type--)) (set v nil)) (progn (habitrpg-get-id (symbol-value --cl-task--) (list ... ... ...))))))))
(progn (let ((--cl-in-habit-- (make-symbol "--in-habit--"))) (let* ((v --cl-in-habit--)) (set v (org-entry-get-with-inheritance "IN_HABITRPG"))) (progn (let ((--cl-last-done-day-- (make-symbol "--last-done-day--"))) (let* ((v --cl-last-done-day--)) (set v (if (member "hrpgdaily" ...) (butlast ... 4)))) (progn (let ((--cl-type-- ...)) (let* (...) (set v nil)) (progn (habitrpg-get-id ... ...))))))))
(let ((--cl-state-- (make-symbol "--state--"))) (let* ((v --cl-state--)) (set v (nth 2 (org-heading-components)))) (progn (let ((--cl-in-habit-- (make-symbol "--in-habit--"))) (let* ((v --cl-in-habit--)) (set v (org-entry-get-with-inheritance "IN_HABITRPG"))) (progn (let ((--cl-last-done-day-- (make-symbol "--last-done-day--"))) (let* ((v --cl-last-done-day--)) (set v (if ... ...))) (progn (let (...) (let* ... ...) (progn ...))))))))
(progn (let ((--cl-state-- (make-symbol "--state--"))) (let* ((v --cl-state--)) (set v (nth 2 (org-heading-components)))) (progn (let ((--cl-in-habit-- (make-symbol "--in-habit--"))) (let* ((v --cl-in-habit--)) (set v (org-entry-get-with-inheritance "IN_HABITRPG"))) (progn (let ((--cl-last-done-day-- ...)) (let* (...) (set v ...)) (progn (let ... ... ...))))))))
(let ((--cl-task-- (make-symbol "--task--"))) (let* ((v --cl-task--)) (set v (nth 4 (org-heading-components)))) (progn (let ((--cl-state-- (make-symbol "--state--"))) (let* ((v --cl-state--)) (set v (nth 2 (org-heading-components)))) (progn (let ((--cl-in-habit-- (make-symbol "--in-habit--"))) (let* ((v --cl-in-habit--)) (set v (org-entry-get-with-inheritance "IN_HABITRPG"))) (progn (let (...) (let* ... ...) (progn ...))))))))
(progn (if (string= major-mode (quote org-agenda-mode)) (org-agenda-switch-to)) (let ((--cl-task-- (make-symbol "--task--"))) (let* ((v --cl-task--)) (set v (nth 4 (org-heading-components)))) (progn (let ((--cl-state-- (make-symbol "--state--"))) (let* ((v --cl-state--)) (set v (nth 2 (org-heading-components)))) (progn (let ((--cl-in-habit-- ...)) (let* (...) (set v ...)) (progn (let ... ... ...))))))))
(unwind-protect (progn (if (string= major-mode (quote org-agenda-mode)) (org-agenda-switch-to)) (let ((--cl-task-- (make-symbol "--task--"))) (let* ((v --cl-task--)) (set v (nth 4 (org-heading-components)))) (progn (let ((--cl-state-- (make-symbol "--state--"))) (let* ((v --cl-state--)) (set v (nth 2 ...))) (progn (let (...) (let* ... ...) (progn ...))))))) (set-window-configuration wconfig))
(let ((wconfig (current-window-configuration))) (unwind-protect (progn (if (string= major-mode (quote org-agenda-mode)) (org-agenda-switch-to)) (let ((--cl-task-- (make-symbol "--task--"))) (let* ((v --cl-task--)) (set v (nth 4 (org-heading-components)))) (progn (let ((--cl-state-- ...)) (let* (...) (set v ...)) (progn (let ... ... ...)))))) (set-window-configuration wconfig)))
(save-excursion (let ((wconfig (current-window-configuration))) (unwind-protect (progn (if (string= major-mode (quote org-agenda-mode)) (org-agenda-switch-to)) (let ((--cl-task-- (make-symbol "--task--"))) (let* ((v --cl-task--)) (set v (nth 4 ...))) (progn (let (...) (let* ... ...) (progn ...))))) (set-window-configuration wconfig))))
habitrpg-add()
call-interactively(habitrpg-add nil nil)

Better offline behaviour (feature request)

When emacs can't reach the internet, currently habitrpg.el gracefully throws errors. Ideally, habitrpg.el would store the changes and then change habitrpg.com when reconnected to the internet.

E.g. the following could happen when not connected to the internet and adding a TODO item:

  1. habitrpg.el finds it can't send data to habitrpg
  2. habitrpg.el stores (somehow) the TODO time
  3. habitrpg.el checks if there's internet (maybe with an idle timer?)
  4. if there is internet, check the list and upload the changes.

MELPA package

It would be nice to have a MELPA package with the module at some point to simplify installation and updates even more. Actually, I might help (no experience with it though).

Variables

Don't use setq for variables like hrpg-id.

Error getting the id for a new task

I use Windows 7 at work. When I try to add a task from an org file by pressing C-c C-x h I get the following error:

Contacting host: habitrpg.com:443
Opening TLS connection to habitrpg.com'... Opening TLS connection withgnutls-cli --insecure -p 443 habitrpg.com'...failed
Opening TLS connection with gnutls-cli --insecure -p 443 habitrpg.com --protocols ssl3'...failed Opening TLS connection withopenssl s_client -connect habitrpg.com:443 -no_ssl2 -ign_eof'...done
Opening TLS connection to `habitrpg.com'...done
REQUEST [error] Error from parser json-read: (end-of-file)
HabitRPG: Error in getting id for task [Add obstacles that decrement the score - like bad sticks or holes in the ground.]

Rename API Key to User ID

The nomenclature used by Habitica itself and the package is different.

Habitica refers to the API key as "USER ID".

Should be a simple refactor that I'm happy to do myself, if you accept a PR.

Feature request: Create TODO if it did not exist, when switching to DONE

(add-hook 'org-after-todo-state-change-hook 'habitrpg-add 'append is triggered whenever one switches a TODO item to DONE. Yet, if a TODO didn't exist at habirpg for that particular task then the DONE wouldn't be registered. I suggest that in these cases, a TODO is created at habitrpg and then intermediately switched to DONE.

Error on startup habitrpg-status

Thanks so much for this package. have been working on getting it set up under spacemacs, and am running into an internal wrong-type-argument error. debug stack trace is in gist below. package is loaded via

    (use-package habitrpg
      :init
      (progn
        (setq habitrpg-api-user "<redacted>")
        (setq habitrpg-api-token "<redacted>")
        (global-set-key (kbd "<f9> a") 'habitrpg-status))

      :config
      (progn
        (add-hook 'org-after-todo-state-change-hook 'habitrpg-add 'append)))

https://gist.github.com/gabeos/0548d4b23deba6b2b75abc23b5cffc2e

If you have any thoughts on how to proceed to get it set up, i'd appreciate any help.

Feature Request : When adding a daily task or todo from org-mode, update due date and/or schedule if set

Both Org and Habitica support Repeating tasks and tasks with due dates. I would ask that support be added so that if a new task is being set from org that any scheduling information be carried over. For example, the following org snippet represents a weekly meeting every Monday from 10-10:30 am:

** TODO [#A] Weekly Sync Meeting                                  :hrpgdaily:
    SCHEDULED: <2016-02-15 Mon 10:00-10:30 +1w>

In Habitica, this would translate to a Daily task that repeats every Monday. This appears to be available in the API, but my lisp-fu is not strong enough to sort out a patch for you (sorry). Also, if it just means setting tags differently, I'd love to hear about it.

`habitrpg-add` fails when TODO has property "habit", but has never been done

I have dailies where habitrpg-add fails, and it only fails when there's not been a repetition yet. Example daily:

** TODO 45m Reading
SCHEDULED: <2015-08-24 Mo .+1d>
:PROPERTIES:
:STYLE:    habit
:END:

gives the following backtrace:

Debugger entered--Lisp error: (wrong-type-argument number-or-marker-p nil)
  *(1.0 nil 86400)
  days-to-time(nil)
  habitrpg-add()
  run-hooks(org-after-todo-state-change-hook)
  byte-code(<here's some bytecode hex stuff>)
  org-todo(nil)
  call-interactively(org-todo nil nil)
  command-execute(org-todo)

habitrpg.el used with ergoemacs (windows)

I am using ergoemacs for windows downloaded from http://ergoemacs.org/index.html. The version is as follows:

GNU Emacs 24.2.1 (i386-mingw-nt6.1.7601) of 2012-08-29 on MARVIN
ErgoEmacs distribution 2.0.0

When I install habitrpg.el as per the instruction I get the following error:

Symbol's function definition is void: cl-eval-when.

I tried commenting this instruction and I get again the same error for cl-defstruct. I believe this is got to do with the cl.el but I am not sure which alternative cl file I can use or if there is any other habitrpg.el i can use which is compatible with ErgoEmacs. Please do the needful and let me know if you need any more information regarding the same.

easy install does not work

Copying and pasting into an emacs buffer, placing the cursor at the end of the document, and then pressing ctrl-j does not give a prompt for the user-id and api-token. instead
" # " is returned.

Add ID to tasks

When I try to add the same task it shouldn't be created again in Habitica.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.