ryjm / habitrpg.el Goto Github PK
View Code? Open in Web Editor NEWorg-mode integration for habitrpg
org-mode integration for 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
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)
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:
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).
Don't use setq
for variables like hrpg-id.
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 with
gnutls-cli --insecure -p 443 habitrpg.com'...failed
Opening TLS connection with gnutls-cli --insecure -p 443 habitrpg.com --protocols ssl3'...failed Opening TLS connection with
openssl 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.]
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.
Version 2 of the Habitica API will be officially deactivated on July 15th.
Here is a migration guide for upgrading to version 3. If you have any questions, feel free to reach out on Github or the Aspiring Comrades Guild.
(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.
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.
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.
I get this error message when I want to habitrpg-add
a TODO item tagged as :hrpgdaily:.
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)
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.
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.
See this blog post. Apparently Carton has been deprecated in favor of Cask.
When I try to add the same task it shouldn't be created again in Habitica.
I get this error when I try to invoke the function habitrpg-add
, in a headline in one of my org-agenda files.
For reference, I followed the standard installation procedure, and I'm using spacemacs.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.