pauldub / activity-watch-mode

Emacs plugin for automatic time tracking and metrics generated from your programming activity.
https://activitywatch.net
70 stars 9 forks source link

json-encode used but json not loaded #2

Closed freemin7 closed 5 years ago

freemin7 commented 5 years ago

Hello

when installing activtiy-watch-mode from melpa on a vanilla emacs (nothing else installed) an error happens, the debugger gives the following stack trace: Debugger entered--Lisp error: (void-function json-encode) json-encode(((hostname . "l191") (client . "emacs-activity-watch") (type . "app.editor.activity"))) activity-watch--create-bucket() activity-watch--call() activity-watch--save() apply(activity-watch--save nil) timer-event-handler([t 23741 49114 0 2 activity-watch--save nil nil 0]) Adding a (require 'json) with the requirements fixes this error.

Steps to reproduce

  1. Make new emacs home mkdir emhome export HOME=path/to/emhome
  2. Start emacs in shell with modifed home & Close it
  3. Fill emhome/.emacs.d/init.el with
    `(setq package-archives '(("gnu" . "https://elpa.gnu.org/packages/") ("melpa" . "https://melpa.org/packages/"))) (package-initialize)

(let ((pkgs-to-install (seq-remove 'package-installed-p '(activity-watch-mode json)))) (when pkgs-to-install (package-refresh-contents) (dolist (pkg pkgs-to-install) (package-install pkg))))

(setq debug-on-error t) (global-activity-watch-mode) (custom-set-variables ;; custom-set-variables was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. '(package-selected-packages (quote (activity-watch-mode)))) (custom-set-faces ;; custom-set-faces was added by Custom. ;; If you edit it by hand, you could mess it up, so be careful. ;; Your init file should contain only one such instance. ;; If there is more than one, they won't work right. )`

  1. Start emacs in shell with modifed home and open a file