gamify-el icon indicating copy to clipboard operation
gamify-el copied to clipboard

I couldn't understand how this package works...

Open maikol-solis opened this issue 2 years ago • 6 comments
trafficstars

Hi!

I installed your package and tried to use with a simple task

According to this blog, more or less this is the configuration of each task.

* TODO test :coding:
:PROPERTIES:
:gamify_exp: "50"
:END:

However, I'm just getting 0.0 in the mode-line.

I don't know what I'm doing wrong.

Thanks for your help.

Best.

maikol-solis avatar Nov 21 '23 23:11 maikol-solis

Ok, I did some progress.

The gamify file was filled with all this stuff

;; -*- emacs-lisp -*-
;; This file was generated by Gamify.
;; DON'T CHEAT, that's gay.

(setq gamify-stats-alist '(
(#("coding" 0 1 (:pm-mode org-mode fontified t :pm-span-old (nil 1 72488 #s(pm-host-chunkmode #s(pm-host-chunkmode eieio--unbound "org" nil org-mode poly-fallback-mode always 2 0 0 nil nil nil nil nil nil nil nil) "org:" eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound #<buffer actionable.org>)) org-todo-head #("TODO" 0 4 (face org-todo)) line-prefix "" wrap-prefix #("* " 0 2 (face org-indent)) :pm-span (nil 1 72488 #s(pm-host-chunkmode #s(pm-host-chunkmode eieio--unbound "org" nil org-mode poly-fallback-mode always 2 0 0 nil nil nil nil nil nil nil nil) "org:" eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound #<buffer actionable.org>)) face org-modern-tag mouse-face highlight keymap (keymap (follow-link . mouse-face) (mouse-3 . org-find-file-at-mouse) (mouse-2 . org-open-at-mouse)) display #(" @" 1 2 (cursor t))) 1 12 (:pm-mode org-mode fontified t :pm-span-old (nil 1 72488 #s(pm-host-chunkmode #s(pm-host-chunkmode eieio--unbound "org" nil org-mode poly-fallback-mode always 2 0 0 nil nil nil nil nil nil nil nil) "org:" eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound #<buffer actionable.org>)) org-todo-head #("TODO" 0 4 (face org-todo)) line-prefix "" wrap-prefix #("* " 0 2 (face org-indent)) :pm-span (nil 1 72488 #s(pm-host-chunkmode #s(pm-host-chunkmode eieio--unbound "org" nil org-mode poly-fallback-mode always 2 0 0 nil nil nil nil nil nil nil nil) "org:" eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound #<buffer actionable.org>)) face org-modern-tag mouse-face highlight keymap (keymap (follow-link . mouse-face) (mouse-3 . org-find-file-at-mouse) (mouse-2 . org-open-at-mouse))) 12 13 (:pm-mode org-mode fontified t :pm-span-old (nil 1 72488 #s(pm-host-chunkmode #s(pm-host-chunkmode eieio--unbound "org" nil org-mode poly-fallback-mode always 2 0 0 nil nil nil nil nil nil nil nil) "org:" eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound #<buffer actionable.org>)) org-todo-head #("TODO" 0 4 (face org-todo)) line-prefix "" wrap-prefix #("* " 0 2 (face org-indent)) :pm-span (nil 1 72488 #s(pm-host-chunkmode #s(pm-host-chunkmode eieio--unbound "org" nil org-mode poly-fallback-mode always 2 0 0 nil nil nil nil nil nil nil nil) "org:" eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound eieio--unbound #<buffer actionable.org>)) face org-modern-tag mouse-face highlight keymap (keymap (follow-link . mouse-face) (mouse-3 . org-find-file-at-mouse) (mouse-2 . org-open-at-mouse)) display "s ")) 150 1700612157.071967 nil nil)
))
(setq gamify-achievements-alist '(
(0 . "t")
))
;; gamify ends here

But thereafter, I can't execute gamify-start again

Debugger entered--Lisp error: (invalid-read-syntax "#" 6 440)
  read(#<buffer  *load*>)
  edebug--read(read #<buffer  *load*>)
  apply(edebug--read read #<buffer  *load*>)
  #f(advice edebug--read :around read)(#<buffer  *load*>)
  load-with-code-conversion("/Users/maikol/org/gtd/gamify" "/Users/maikol/org/gtd/gamify" nil nil)
  load-file("/Users/maikol/org/gtd/gamify")
  gamify-start()
  funcall-interactively(gamify-start)
  command-execute(gamify-start record)
  execute-extended-command(nil "gamify-start" nil)
  funcall-interactively(execute-extended-command nil "gamify-start" nil)
  command-execute(execute-extended-command)

maikol-solis avatar Nov 22 '23 00:11 maikol-solis

After reviewing a little your code, the problem is with polymode

If I disable poly-org just before mark the item as "DONE", then the gamify file appears as excepted (I think so).

;; -*- emacs-lisp -*-
;; This file was generated by Gamify.
;; DON'T CHEAT, that's gay.

(setq gamify-stats-alist '(
("coding" 50 1700613685.29488 nil nil)
))
(setq gamify-achievements-alist '(
))
;; gamify ends here

maikol-solis avatar Nov 22 '23 00:11 maikol-solis

Hi Maikol, Looking at my gamify file it seems that fontified names are present. I do have a customized modeline setup for gamify and don't use the one provided by default so that probably is at fault here. Removing fontification before the skill is added to the file should be fine though.

Idorobots avatar Nov 22 '23 08:11 Idorobots

I made it defontify the text when ingesting it initially. Can you please check if that solves the issue for you?

Idorobots avatar Nov 22 '23 08:11 Idorobots

Thanks! The package works much better now.

To start using this on the daily-basis, I created this dummy function just to add experience points to my items, according to your .emacs.d.

You can generalize for the package if you like:

(defun gamify-add-exp-to-item ()
    "Add points to item at point"
    (interactive)
    (let* ((level (completing-read "Which level has this task?"
                                   '("Easy" "Medium" "Hard")
                                   nil t))
           (exp (pcase level
                  ("Easy" (gamify-assign-some-exp 5 2))
                  ("Medium" (gamify-assign-some-exp))
                  ("Hard" (gamify-assign-some-exp 30 10)))))
      (org-set-property gamify-exp-property exp)))

maikol-solis avatar Nov 22 '23 16:11 maikol-solis